You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by yulinxp <yu...@gmail.com> on 2008/01/09 19:49:52 UTC
.NET client
I use JAX-WS Front End, Code-First development. I can use java client to
connect to CXF service. Now I need to make sure .NET Client work.
Unfortunately, I know nothing about .NET. Can anyone give me some
ideas/tips?
I looked into some of the posts:
http://www.nabble.com/WSDL-not-recognized-by-vs-net-td13132033.html#a13132033
http://www.nabble.com/Generated-wsdl-in-XFire-Versus-CXF-td12357856.html#a13131774
The problem was .NET might complain the wsdl file generated in CXF. Belows
are the wsdl using wrapped vs. bare.
I also try wsdlvalidator tool as mentioned here
htttp://www.nabble.com/Microsoft-interoperability-td13115417.html#a13115687
C:\>wsdlvalidator HelloWorld_wrapped.wsdl
Passed Validation : Valid WSDL
C:\>wsdlvalidator HelloWorld_bare.wsdl
WSDLValidator Error : WSI-BP-1.0 R2210 violation: Operation 'sayHi' more
than one part bound to body
wsdlvalidator complains about HelloWorld_bare.wsdl. But java client was able
to connect WS using either wrapped or bare wsdl. So which SOAPBinding is
safe for .NET Client?
//interface
public interface HelloWorld {
public java.lang.String sayHi(java.lang.String text,
demo.spring.ProfileInfo info) throws BusinessLogicException;
}
//HelloWorld_wrapped.wsdl
<?xml version="1.0" encoding="utf-8"?><wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://spring.demo/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="HelloWorldService" targetNamespace="http://spring.demo/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="unqualified" elementFormDefault="unqualified"
targetNamespace="http://spring.demo/" xmlns:tns="http://spring.demo/">
<xs:element name="BusinessLogicFaultDetail" nillable="true"
type="tns:BusinessLogicFaultDetail"/>
<xs:element name="sayHi" nillable="true" type="tns:sayHi"/>
<xs:element name="sayHiResponse" nillable="true" type="tns:sayHiResponse"/>
<xs:complexType name="sayHi">
<xs:sequence>
<xs:element minOccurs="0" name="text" type="xs:string"/>
<xs:element minOccurs="0" name="info" type="tns:profileInfo"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="profileInfo">
<xs:sequence>
<xs:element minOccurs="0" name="addressLine1" type="xs:string"/>
<xs:element minOccurs="0" name="addressLine2" type="xs:string"/>
<xs:element minOccurs="0" name="city" type="xs:string"/>
<xs:element minOccurs="0" name="companyName" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
<xs:element minOccurs="0" name="fax" type="xs:string"/>
<xs:element minOccurs="0" name="firstName" type="xs:string"/>
<xs:element minOccurs="0" name="lastName" type="xs:string"/>
<xs:element minOccurs="0" name="middleName" type="xs:string"/>
<xs:element minOccurs="0" name="mobile" type="xs:string"/>
<xs:element minOccurs="0" name="phone" type="xs:string"/>
<xs:element minOccurs="0" name="state" type="xs:string"/>
<xs:element minOccurs="0" name="status" type="xs:string"/>
<xs:element minOccurs="0" name="zip" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="sayHiResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BusinessLogicFaultDetail"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="BusinessLogicException">
<wsdl:part element="tns:BusinessLogicFaultDetail"
name="BusinessLogicException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="sayHiResponse">
<wsdl:part element="tns:sayHiResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="sayHi">
<wsdl:part element="tns:sayHi" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="HelloWorld">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:sayHi" name="sayHi">
</wsdl:input>
<wsdl:output message="tns:sayHiResponse" name="sayHiResponse">
</wsdl:output>
<wsdl:fault message="tns:BusinessLogicException"
name="BusinessLogicException">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloWorldServiceSoapBinding" type="tns:HelloWorld">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHi">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="sayHi">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="sayHiResponse">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="BusinessLogicException">
<soap:fault name="BusinessLogicException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloWorldService">
<wsdl:port binding="tns:HelloWorldServiceSoapBinding"
name="HelloWorldPort">
<soap:address
location="http://localhost:9090/spring_http/ws/ServerEndPoint"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
message sent:
<soap:Body>
<ns2:sayHi xmlns:ns2="http://spring.demo/">
<text>OK</text>
<info>
<firstName>MyFirstName</firstName>
<lastName>MyLastName</lastName>
<state>MyState</state>
</info>
</ns2:sayHi>
</soap:Body>
//HelloWorld_bare.wsdl
<?xml version="1.0" encoding="utf-8"?><wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://spring.demo/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="HelloWorldService" targetNamespace="http://spring.demo/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://spring.demo/" attributeFormDefault="unqualified"
elementFormDefault="unqualified" targetNamespace="http://spring.demo/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://spring.demo/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="profileInfo">
<xs:sequence>
<xs:element minOccurs="0" name="addressLine1" type="xs:string"/>
<xs:element minOccurs="0" name="addressLine2" type="xs:string"/>
<xs:element minOccurs="0" name="city" type="xs:string"/>
<xs:element minOccurs="0" name="companyName" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
<xs:element minOccurs="0" name="fax" type="xs:string"/>
<xs:element minOccurs="0" name="firstName" type="xs:string"/>
<xs:element minOccurs="0" name="lastName" type="xs:string"/>
<xs:element minOccurs="0" name="middleName" type="xs:string"/>
<xs:element minOccurs="0" name="mobile" type="xs:string"/>
<xs:element minOccurs="0" name="phone" type="xs:string"/>
<xs:element minOccurs="0" name="state" type="xs:string"/>
<xs:element minOccurs="0" name="status" type="xs:string"/>
<xs:element minOccurs="0" name="zip" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="BusinessLogicFaultDetail"
type="BusinessLogicFaultDetail"/>
<xs:complexType name="BusinessLogicFaultDetail">
<xs:sequence/>
</xs:complexType>
<xs:element name="text" nillable="true" type="xs:string"/>
<xs:element name="info" nillable="true" type="profileInfo"/>
<xs:element name="sayHiResponse" nillable="true" type="xs:string"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="BusinessLogicException">
<wsdl:part element="tns:BusinessLogicFaultDetail"
name="BusinessLogicException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="sayHiResponse">
<wsdl:part element="tns:sayHiResponse" name="sayHiResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="sayHi">
<wsdl:part element="tns:text" name="text">
</wsdl:part>
<wsdl:part element="tns:info" name="info">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="HelloWorld">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:sayHi" name="sayHi">
</wsdl:input>
<wsdl:output message="tns:sayHiResponse" name="sayHiResponse">
</wsdl:output>
<wsdl:fault message="tns:BusinessLogicException"
name="BusinessLogicException">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloWorldServiceSoapBinding" type="tns:HelloWorld">
<soap12:binding style="document"
transport="http://www.w3.org/2003/05/soap/bindings/HTTP/"/>
<wsdl:operation name="sayHi">
<soap12:operation soapAction="" style="document"/>
<wsdl:input name="sayHi">
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output name="sayHiResponse">
<soap12:body use="literal"/>
</wsdl:output>
<wsdl:fault name="BusinessLogicException">
<soap12:fault name="BusinessLogicException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloWorldService">
<wsdl:port binding="tns:HelloWorldServiceSoapBinding"
name="HelloWorldPort">
<soap12:address
location="http://localhost:9090/spring_http/ws/ServerEndPoint"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
message sent:
<soap:Body>
<ns2:text xmlns:ns2="http://spring.demo/">OK</ns2:text>
<ns2:info xmlns:ns2="http://spring.demo/">
<firstName>MyFirstName</firstName>
<lastName>MyLastName</lastName>
state>MyState</state>
</ns2:info>
</soap:Body>
--
View this message in context: http://www.nabble.com/.NET-client-tp14718103p14718103.html
Sent from the cxf-user mailing list archive at Nabble.com.