|
List Info
Thread: XSUL Dynamic Invoker Problem with .NET
|
|
| XSUL Dynamic Invoker Problem with .NET |

|
2006-10-31 17:52:19 |
|
Hello list!
I got the latest xsul library(2.7.9), and everything
is working fine when dynamic invoking some web services (deployed in
axis, phpnusoap, websphere), except for the Document/Literal Wrapped
.NET Web Services.
With
the logging utility enabled, I can see that the SOAP envelope is not
sending the parameters correctly when the service is in .NET!
My args are http://localhost/GetPrice/Service.asmx?WSDL getPrice keyboard
The
envelope is incorrect (in bold), the value of "item" is not included
(should be <item>keyboard</item> isn't it?). I'm also
attaching the .wsdl of the .NET service, and the .java of xsul dynamic
invoker (without the selftest and stuff).
Thanks in advance for any help!
Best regards,
Andre
############### ENVELOPE ################ <?xml version='1.0' encoding='utf-8'?> <S:Envelope xmlns sd='
http://www.w3.org/2001/XMLSchema' xmlns si='
http://www.w3.org/2001/XMLSchema-instance' xmlns:wsa='
http://www.w3.org/2005/08/addressing' xmlns:wsp='http://schemas.xmlsoap.org/ws/2002/12/policy
' xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'
> <S:Header> <wsa:To>http://localhost/GetPrice/Service.asmx</wsa:To>
<wsa:Action>
http://tempuri.org//ServiceSoap/getPrice</wsa:Action> </S:Header> <S:Body> <n1:item xmlns:n1='
http://tempuri.org/' />
</S:Body>
</S:Envelope>
############### WSDL ################
<?xml
version="1.0" encoding="utf-8" ?>
- <
s:element name
="item">
<s:element minOccurs="0
" maxOccurs="1" name="item"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <
s:element name
="getPriceResponse">
<s:element minOccurs="1
" maxOccurs="1" name="getPriceResult"
type="s:double" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
- <
wsdl:message name
="getPriceSoapIn">
<wsdl:part name="parameters
"
element="tns:item" />
</wsdl:message>
- <
wsdl:message name
="getPriceSoapOut">
<wsdl:part name="parameters
"
element="tns:getPriceResponse" />
</wsdl:message>
- <
wsdl:portType name
="ServiceSoap">
+ <
wsdl:operation name
="getPrice">
<wsdl:input message="tns:getPriceSoapIn
" />
<wsdl:output message="tns:getPriceSoapOut
" />
</wsdl:operation>
</wsdl:portType>
- <
wsdl:binding name
="ServiceSoap"
type="tns:ServiceSoap">
- <
wsdl:operation name
="getPrice">
<soap:body use="literal
" />
</wsdl:input>
<soap:body use="literal
" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <
wsdl:binding name
="ServiceSoap12"
type="tns:ServiceSoap">
- <
wsdl:operation name
="getPrice">
<soap12:body use="literal
" />
</wsdl:input>
<soap12:body use="literal
" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <
wsdl:service name
="Service">
- <
wsdl:port name
="ServiceSoap"
binding="tns:ServiceSoap">
- <
wsdl:port name
="ServiceSoap12"
binding="tns:ServiceSoap12">
</wsdl:service>
</wsdl:definitions>
######################## JAVA #########################
import java.io.File
; import java.net.URI; import java.util.Iterator; import java.util.List; import javax.xml.namespace.QName; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlInfosetBuilder; import
xsul.MLogger; import xsul.XmlConstants; import xsul.wsdl.WsdlBindingOperation; import xsul.wsdl.WsdlDefinitions; import xsul.wsdl.WsdlMessage; import xsul.wsdl.WsdlPortTypeOperation; import xsul.wsdl.WsdlResolver
; import xsul.wsif.WSIFException; import xsul.wsif.WSIFMessage; import xsul.wsif.WSIFOperation; import xsul.wsif.WSIFPort; import xsul.wsif.WSIFService; import xsul.wsif.WSIFServiceFactory; import xsul.wsif.impl.WSIFMessageElement
; import xsul.wsif.spi.WSIFProviderManager;
public class XsulDynamicInvoker { private final static MLogger logger = MLogger.getLogger(); private final static XmlInfosetBuilder builder = XmlConstants.BUILDER
; private static void usage(String errMsg) { System.err.println("Usage: {WSDL URL} {operation name} [parameters ...]"); }
public static void main(String[] args) throws Exception
{ System.err.println("Starting "+XsulDynamicInvoker.class.getName()); WSIFProviderManager.getInstance().addProvider( new xsul.wsif_xsul_soap_http.Provider() ); runClient(args);
}
private static void runClient(String[] args) throws Exception { URI base = ((new File(".")).toURI()); if(args.length < 2) { usage("at least two argument required");
}
String wsdlLoc = args[0];
String opName = args[1]; String portName = null; if(opName.charAt(0) == '{') { int pos = opName.indexOf('}');
portName =
opName.substring(1, pos); opName = opName.substring(pos+1); &nbs | |