users@jax-rpc.java.net

RE: Namespaces causing a .NET interoperability issue

From: Sam Gardner-Dell <sgardner-dell_at_piper-group.com>
Date: Thu, 16 Dec 2004 11:23:13 -0000

Thanks Eric, this has helped to point me in the right direction.

The solution is to specify this for the VB web-service:

<SoapDocumentService(RoutingStyle:=SoapServiceRoutingStyle.RequestElement, Use:=SoapBindingUse.Encoded), _
 System.Web.Services.WebService(Namespace:="http://www.trilogi.co.uk/clientxmlrpc")> _
Public Class Service1
    Inherits System.Web.Services.WebService
....


This solves a number of interoperability issues I have been having:
  RoutingStyle:=SoapServiceRoutingStyle.RequestElement - This tells .net to ignore the SOAPAction HTTP header using the soap body of the soap message to determine the required function
  Use:=SoapBindingUse.Encoded - This tells it to use the encoding as specified and alters the behaviours to use prefixed namespace.

Regards,


Sam


-----Original Message-----
From: Eric Rajkovic [mailto:eric.rajkovic_at_oracle.com]
Sent: 15 December 2004 17:54
To: users_at_jax-rpc.dev.java.net
Subject: RE: Namespaces causing a .NET interoperability issue


Sam,

The difference between the two requests is that the Client assums 'elementFormDefault=qualified' in one case.

<sendExternalEndpointForm xmlns="http://www.trilogi.co.uk/clientxmlrpc">
   <String_1 xsi:type="xsd:string">Some String Message</String_1>
</sendExternalEndpointForm>

Because the wrapper element uses a default namespace, the child - String_1 - is also in the default namespace.

With the use of ns0 prefix, in the other case, the child is unqualified - in no namespace.

You could expect Microsoft server to report a fault in this case, but they don't and assumes it's not their.

If you have control over the server side, try to change the default value.

In C#, it's something like, in the method's declaration:

[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] long a

In the WSDL, look for
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws.oracle.com/demo/">
      <s:element name="add">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="a" type="s:long" />
            <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="b" type="s:long" />
          </s:sequence>
        </s:complexType>
      </s:element>

Hth,
eric
 

-----Original Message-----
From: Sam Gardner-Dell [mailto:sgardner-dell_at_piper-group.com]
Sent: Wednesday, December 15, 2004 7:53 AM
To: users_at_jax-rpc.dev.java.net
Subject: Namespaces causing a .NET interoperability issue

Hi folks,

I am having difficulties when attempting to send a message to a .NET web-service (written with vb).

This is an example of what is generated by JAX-RPC when it sends a message to the VB web-service. You'll notice that the namespace ns0 is defined and then the sendExternalEndpointForm element is prefixed with ns0 to qualify it for this namespace.
Although syntactically correct, the vb.net service ignores the contents of String_1 in this circumstance (writing an empty string to disk), even though the IIS server issues a 200 OK response, with a SOAP response that indicates success.

POST /trilogitest/Service1.asmx HTTP/1.1
Content-Type: text/xml; charset="utf-8"
Content-Length: 530
SOAPAction: "http://www.trilogi.co.uk/clientxmlrpc/sendExternalEndpointForm"
Host: localhost

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://www.trilogi.co.uk/clientxmlrpc" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><ns0:sendExternalEndpointForm><String_1 xsi:type="xsd:string">Some String Message</String_1></ns0:sendExternalEndpointForm></env:Body></env:Envelope>


However removing the ns0 definition and explicitly qualifying the namespace for sendExternalEndpointForm as show below resolves the issue, vb.net processes this next request perfectly, writing the string to a file on disk as expected:

POST /trilogitest/Service1.asmx HTTP/1.1
Content-Type: text/xml; charset="utf-8"
Content-Length: 518
SOAPAction: "http://www.trilogi.co.uk/clientxmlrpc/sendExternalEndpointForm"
Host: localhost

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><sendExternalEndpointForm xmlns="http://www.trilogi.co.uk/clientxmlrpc"><String_1 xsi:type="xsd:string">Some String Message</String_1></sendExternalEndpointForm></env:Body></env:Envelope>


I can appreciate that this may be considered a .NET interoperability issue but if anyone has any suggestions I would very much like to hear them.
Thanks in advance,


Sam Gardner-Dell
Analyst Developer
Piper Group plc
Email: sgardner-dell_at_piper-group.com
Tel: + 44 (0) 1454 284900
Fax: + 44 (0) 1454 284950
Mobile:+ 44 (0) 7967 681415
www.piper-group.com
Information contained in this e-mail is intended for the use of the addressee only, and is confidential and may be the subject of legal professional privilege. Any dissemination, distribution, copying or use of this communication without permission of the addressee is strictly prohibited. The views expressed in this communication may not necessarily be the views held by Piper Group plc.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net