Indigo March CTP interop troubleshooting notes

This is belated, but I felt was important to get out. Simon Fell made couple firm but fair comments on Indigo March CTP interop (thanks for feedback:) ).

Here are some troubleshooting notes on the CTP interop and update on what to expect in upcoming next Indigo public drop, mostly repeating my offline discussion with Simon. 

1) As noted by many, you need to always use
svcutil.exe /uxs <url>
switch when you import wsdl not generated by Indigo. When complex types are used, you need to use
svcutil.exe /tm /uxs <url>
to generate typed messages. This will be still true in next Indigo public drop.

2)       Element order while serializing request.
svcutil.exe has a bug where it will not preserve the order of the children of the direct child of the Body when /tm switch is used. Instead it will serialize fields alphabetically. For example, schema is:

<complexType name="login">
<sequence>
    <element name="user" type="xs:string"/>
    <element name="password" type="xs:string"/>
</sequence>
</complexType>
We generate
[System.ServiceModel.MessageContractAttribute()]
public class login_RequestMessage
{
    [System.ServiceModel.MessageBodyAttribute(Namespace = "...")]
    public string username;

    [System.ServiceModel.MessageBodyAttribute(Namespace = "...")]
    public string password;
}
and serialize invalid instance:
<foo>
   <password>..</password>
   <user>...</password>
</foo>

The reason is:
with /tm switch we map the direct child of the body to a class that supports MessageContract. MessageBody attribute for MessageContract class fields has additional parameter “Position” that svcutil.exe "forgets" to emit.

Workaround: add inside the proxy Position parameter to MessageBody attribute:

[System.ServiceModel.MessageContractAttribute()]
public class login_RequestMessage
{
    [System.ServiceModel.MessageBodyAttribute(Namespace = "urn:enterprise.soap.sforce.com", Position = 0)]
    public string username;

    [System.ServiceModel.MessageBodyAttribute(Namespace = "urn:enterprise.soap.sforce.com", Position = 1)]
    public string password;
}

The message would become correct.  Unfortunately this bug will be present in the next Indigo public drop as well.

3)       generated SOAPAction header does not match WSDL.
This has been fixed in upcoming CTP.

4)       Exception during deserialization of the fault content.

In March CTP bits we had problems with parsing <detail> element as well as handling whitespaces inside elements. This has been fixed in next Indigo public drop. We translate Fault into “UnknownFault” exception with access to fault info.

5)       the generated proxy for operations that are maxOccurs="unbound" don't generate an array in the generated xxx_RequestMessage object
Bug in March CTP bits, fixed in the next Indigo public drop

6)      endpoint URL is in WSDL but doesn't end up in the generated proxy anywhere
this is by design – we generate address into config. The idea is that everything from wsdl:binding and wsdl:port goes into config (except for settings that impact serialization and action URIs), since it can change from deployment to deployment.

7)       How do I change proxy to use https?

In addition to changing the url, you need to use httpsTransport inside <customBinding> or use BasicSecurityProfileBinding (changed it in B1 to be just an attribute on the BasicProfileBinding). In the next Indigo public drop svcutil.exe correctly generates one or another in the config based on the url.

 


Posted May 11 2005, 09:33 PM by kirill-gavrylyuk
Filed under:

Comments

Arun Gupta's Blog wrote Indigo troubleshooting tips from Kirill
on 05-13-2005 7:38 PM
Indigo troubleshooting tips from Kirill
Simon Fell > Its just code wrote Kirill on Indigo
on 05-16-2005 10:14 PM
Kirill finally caved and started a blog, included are a bunch of notes on the issues I was running into with Indigo, thanks Kirill!
Javier Arguello wrote re: Indigo March CTP interop troubleshooting notes
on 09-21-2005 7:17 AM
Hi!
I've been trying to create an operationcontract in Indigo that returns a class that contains XmlAnyElement member, but I keep getting a 500 (internal server error) from the webserver when trying to read the wsdl for the service.

Any ideas why?
Paul Downey wrote re: Indigo March CTP interop troubleshooting notes
on 10-18-2006 5:02 AM
seems like the /tm /uxs options have gone from svcutil in the SDK / .NET 3.0 4506.3 release .. any ideas on what we should use instead?

Add a Comment

(required)  
(optional)
(required)  
Remember Me?