Hi

The intended Web Service is published with some defined services. In other module to call the service, I have used apache cxf 2.2.6 for generate the stubs from the running web service. Then I call the web service with the following code snippet

       JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
       factoryBean.setServiceClass(Service.class);
       System.out.println("Connecting service ...");
       factoryBean.setAddress("Service URL");
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:143)
   at $Proxy52.getAccountInformation(Unknown Source)
at com.seamless.customer.ye_mtn_ocslink.test.MTNOCSTest.main(MTNOCSTest.java:43) Caused by: org.apache.cxf.binding.soap.SoapFault: A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint. at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46) at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:55) at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:46) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
   at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:658)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2139) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
   at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302)
   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
   at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123)
   ... 2 more



Thanks
Ayan

sabbir wrote:
Please explain the problem in details.


Ayan Chakraborty wrote:
Thanks Sabbir for your reply. I am calling with Java. It seems it should be related to Web Service Client.Please help me to fix the problem.

sabbir wrote:
Thanks Daniel for your reply. I was confused if there is other standard
to
expose webservice for other platform even soap has standard.
I resolved the issue by myself, it was the issue with Php SOAP Client.
Soap
Client was generating a extra parameter block.
I posting the code if it may help to others user...
I used nusoap.

$endpoint = "http://server:8080/provision/services/provision";;
$ns = "provision.ws.namespace.com";
$client = new nusoapclient($endpoint);
$result = $client->call('doTest', array ('index' => 12), $ns);

echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) .
'</pre>';




dkulp wrote:
This would be an issue on the PHP side.    I'm not sure if any of us
have
used the PHP soap stuff so I'm not sure what the solution would be. Do they have a mailing list to ask on?

Dan


On Monday 12 April 2010 8:53:06 pm sabbir wrote:
Hi,

Im trying the consume a web service by PHP. The web service is exposed
by
CXF.
But when php request like following...There is a block <parameters> in
request ?? So im getting a error message in Server console

org.apache.cxf.interceptor.Fault: Unexpected wrapper element parameters
found.   Expected {provision.ws.vipernetworks.com}doTest.


Address: /provision/services/provision
Encoding: ISO-8859-1
Content-Type: text/xml; charset=ISO-8859-1
Headers: {content-type=[text/xml; charset=ISO-8859-1],
host=[server:8080],
Content-Length=[424], SOAPAction=["doTe
st"], user-agent=[NuSOAP/0.7.2 (1.94)], Content-Type=[text/xml;
charset=ISO-8859-1]}
Payload: <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/e
nvelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:tns="provision.ws.vipernetworks.com">

<SOAP-ENV:Body>
<parameters>
<index xmlns="">10</index>
</parameters>

</SOAP-ENV:Body></SOAP-ENV:Envelope>


But In soapUI works fine.


Service WSDL :


  <?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions name="ProvisionImplService"
targetNamespace="provision.ws.vipernetworks.com"
xmlns:ns1="http://cxf.apache.org/bindings/xformat";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:tns="provision.ws.vipernetworks.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
- <wsdl:types>
- <xs:schema elementFormDefault="unqualified"
targetNamespace="provision.ws.vipernetworks.com" version="1.0"
xmlns:tns="provision.ws.vipernetworks.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
  <xs:element name="doTest" type="tns:doTest" />
  <xs:element name="doTestResponse" type="tns:doTestResponse" />
- <xs:complexType name="doTest">
- <xs:sequence>
  <xs:element name="index" type="xs:int" />
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="doTestResponse">
- <xs:sequence>
  <xs:element minOccurs="0" name="return" type="xs:string" />
  </xs:sequence>
  </xs:complexType>
  </xs:schema>
  </wsdl:types>
- <wsdl:message name="doTest">
  <wsdl:part element="tns:doTest" name="parameters" />
  </wsdl:message>
- <wsdl:message name="doTestResponse">
  <wsdl:part element="tns:doTestResponse" name="parameters" />
  </wsdl:message>
- <wsdl:portType name="Provision">
- <wsdl:operation name="doTest">
  <wsdl:input message="tns:doTest" name="doTest" />
  <wsdl:output message="tns:doTestResponse" name="doTestResponse" />
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="ProvisionImplServiceSoapBinding"
type="tns:Provision"> <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"; />
- <wsdl:operation name="doTest">
  <soap:operation soapAction="" style="document" />
- <wsdl:input name="doTest">
  <soap:body use="literal" />
  </wsdl:input>
- <wsdl:output name="doTestResponse">
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="ProvisionImplService">
- <wsdl:port binding="tns:ProvisionImplServiceSoapBinding"
name="ProvisionImplPort">
  <soap:address
location="http://server:8080/provision/services/provision";
/>
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>


Please let me know if there any way exposing the Service ?
--
Daniel Kulp
[email protected]
http://dankulp.com/blog





Reply via email to