Hi, I altered the operation style to "document" in the Call object, but when the request shows up as:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<PartnerIdentity xmlns="">[EMAIL PROTECTED]</PartnerIdentity>
<PartnerEvidence xmlns="">09242004153635957:MjAxZTkxMDgyZDMzMjhlZmYxZWU1M2MxYjFjN2NiMjI=</PartnerEvidence>
<UserIdentity xmlns="">166.154.160.251</UserIdentity>
<UserEvidence xmlns="">[EMAIL PROTECTED]</UserEvidence>
<ProductID xmlns="">800002</ProductID>
<ProductVersion xmlns="">1.0</ProductVersion>
</soapenv:Body>
without the <isUserEntitled></isUserEntitled> method name wrapping the parameters in the body... is there a way to create a document/literal style that i need? sorry if this is a simplistic question, but i've been banging on this problem for a while...
thanks again!
-----Original Message-----
From: Sunkara, Jayachandra S [mailto:[EMAIL PROTECTED]]
Sent: Fri 9/24/2004 1:09 PM
To: [EMAIL PROTECTED]
Subject: RE: Axis client to .NET server problems
Make sure you don't have your client configured to send the soap message
in the RPC/literal style.
Follow DOCUMENT/literal style. That should work fine. That's what I did,
when I experienced similar problem interoping with a .NET server. .NET
by default assumes DOC/lit style I guess.
HTH
jayachandra
_____
From: Peter S. Ng [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 24, 2004 10:20 PM
To: [EMAIL PROTECTED]
Subject: Axis client to .NET server problems
Hi,
I have created a client using AXIS to talk to a .NET service....
however, I always this error:
-------------
http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException:
SimpleDeserializer encountered a child element, which is NOT expected,
in something it was trying to deserialize.
at
org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeser
ializer.java:148)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Deseria
lizationContextImpl.java:1001)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:
159)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.j
ava:1050)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:196)
at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:310)
at org.apache.axis.client.Call.invoke(Call.java:2381)
at org.apache.axis.client.Call.invoke(Call.java:2280)
at org.apache.axis.client.Call.invoke(Call.java:1741)
at
com.kargo.verizon.soap.VerizonBillingSoapModule.isUserEntitled(VerizonBi
llingSoapModule.java:116)
at
com.kargo.verizon.soap.VerizonBillingSoapModule.main(VerizonBillingSoapM
odule.java:170)
---------------------
Here is the WDSL snippet of the .NET service i want to call:
<s:schema elementFormDefault="qualified"
targetNamespace="http://www.company.com/Partners/">
<s:element name="IsUserEntitled">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="PartnerIdentity" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="PartnerEvidence" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="UserIdentity"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="UserEvidence"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ProductID"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ProductVersion"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
--------------------
my axis client is sending this request to that service:
POST /PartnerServices/PartnerServiceLocator.asmx?WSDL HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related,
text/*
User-Agent: Axis/1.2beta
Host: 209.11.32.229:7071
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://www.company.com/Partners/IsUserEntitled"
Content-Length: 754
Authorization: Basic S2FyZ29ASU5TUFBhcnRuZXIuY29tOjl0NC5TZ3lYSzA=
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<IsUserEntitled xmlns="http://www.InfoSpace.com/Partners/">
<PartnerIdentity xmlns="">[EMAIL PROTECTED]</PartnerIdentity>
<PartnerEvidence
xmlns="">09242004123247610:YTM2MzUyYjQ4ZDFhNTA1NjMwZTliMThiMzBjNWQ5NWI=<
/PartnerEvidence>
<UserIdentity xmlns="">166.154.xxx.xxxx</UserIdentity>
<UserEvidence xmlns="">05609EEFA140D10CAC</UserEvidence>
<ProductID xmlns="">800002</ProductID>
<ProductVersion xmlns="">1.0</ProductVersion>
</IsUserEntitled>
</soapenv:Body>
---------------------------
i believe the problem is that all the parameters are specifying
"xmlns="" " and the .NET service is asking for qualified namespaces... i
believe the solution is to try and remove the xmlns="" from the
parameters like so:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<IsUserEntitled xmlns="http://www.InfoSpace.com/Partners/">
<PartnerIdentity>[EMAIL PROTECTED]</PartnerIdentity>
<PartnerEvidence>09242004123247610:YTM2MzUyYjQ4ZDFhNTA1NjMwZTliMThiMzBjN
WQ5NWI=</PartnerEvidence>
<UserIdentity>166.154.160.251</UserIdentity>
<UserEvidence>[EMAIL PROTECTED]</UserEvidence>
<ProductID>800002</ProductID>
<ProductVersion>1.0</ProductVersion>
</IsUserEntitled>
</soapenv:Body>
-----------------------
however, in the various ways i have set up my axis client, i can't get
the request to be formatted in this way. i am fairly new to using axis,
so i may not be configuring it correctly to do what i want it to do...
here is the code snippet:
Service service = new Service();
Call call = (Call) service.createCall();
// Set username/password
call.setUsername(_partnerId);
call.setPassword(_password);
// Set the target service to send to
System.setProperty("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new Provider());
URL targetUrl = new URL(_targetEndpoint2);
call.setTargetEndpointAddress(targetUrl);
call.setOperationName(new QName(
"http://www.company.com/Partners/",
"IsUserEntitled"));
call.setOperationStyle("rpc");
call.setOperationUse("literal");
// Map the parameter names to the soap method
call.addParameter("PartnerIdentity", XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter("PartnerEvidence", XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter("UserIdentity", XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter("UserEvidence", XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter("ProductID", XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter("ProductVersion", XMLType.XSD_STRING,
ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
call.setProperty(Call.SOAPACTION_USE_PROPERTY, new
Boolean(true));
call.setProperty(Call.SOAPACTION_URI_PROPERTY,
"http://www.company.com/Partners/IsUserEntitled");
// Invoke the soap call here calling this object method
System.out.println("Invoking call....");
(String) call.invoke(new Object[] { _partnerId,
_partnerEvidence, userId, userEvidence, productId,
productVersion });
---------------
any suggestion as to what i am doing wrong? any help would be
appreciated...
thanks,
peter
Title: RE: Axis client to .NET server problems
- Axis client to .NET server problems Peter S. Ng
- RE: Axis client to .NET server problems Sunkara, Jayachandra S
- RE: Axis client to .NET server problems Peter S. Ng
- RE: Axis client to .NET server problems Anne Thomas Manes
- RE: Axis client to .NET server problems Anne Thomas Manes
