I have the following WSDL file uploaded to Windows Azure Webistes
http://pippogr.azurewebsites.net/ChurchGuideServices.svc?wsdl
Can you tell me what are the values for the Soap_ACtion MEthod name, namespace for the Method: GetMessage
Thanks
You can find it with in binding tag.....
<wsdl:operation name="GetMessage">
<soap:operation soapAction="http://tempuri.org/IChurchGuideServices/GetMessage" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
and Namespace:
xmlns:tns="http://tempuri.org/"
Related
I created a SOAP service in .Net standard using Visual Studio 2019, see code below
The service has a HelloWorld function which correctly returns "Hello World" when queried using Postman (see query below)
I copy the WSDL for my service and save it as a .wsdl on my desktop (see WSDL below)
I successfully upload the WSDL to Azure in API Management
When running the HelloWorld function, I get a 500 error. Why is this?
Service.asmx:
Imports System.Web.Services
Imports System.ComponentModel
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://mynamespace.com/")>
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class Service
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
End Class
POST (http://localhost:58904/Service.asmx/HelloWorld) (returns "Hello World")
<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<HelloWorld xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://mynamespace.com/" />
</Body>
</Envelope>
WSDL
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://mynamespace.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://mynamespace.com/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://mynamespace.com/">
<s:element name="HelloWorld">
<s:complexType/>
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="HelloWorldSoapIn">
<wsdl:part name="parameters" element="tns:HelloWorld"/>
</wsdl:message>
<wsdl:message name="HelloWorldSoapOut">
<wsdl:part name="parameters" element="tns:HelloWorldResponse"/>
</wsdl:message>
<wsdl:portType name="ServiceSoap">
<wsdl:operation name="HelloWorld">
<wsdl:input message="tns:HelloWorldSoapIn"/>
<wsdl:output message="tns:HelloWorldSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServiceSoap" type="tns:ServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="HelloWorld">
<soap:operation soapAction="http://mynamespace.com/HelloWorld" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ServiceSoap12" type="tns:ServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="HelloWorld">
<soap12:operation soapAction="http://mynamespace.com/HelloWorld" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Service">
<wsdl:port name="ServiceSoap" binding="tns:ServiceSoap">
<soap:address location="https://localhost:44380/Service.asmx"/>
</wsdl:port>
<wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12">
<soap12:address location="https://localhost:44380/Service.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Error
Unable to connect to the remote server
BackendConnectionFailure
Failed method: forward-request
Apache CXF 3.1.8 Codegen-cxf-plugin disable validation
I'm using Codegen-cxf-plugin in my ejb project to work as soap client.
When I try to initialize service:
private static WsProviderPortType lkService = null;
WsProviderService lk = new WsProviderService(new URL(AppConfig.getConfig().getProperty("lk.service")));
lkService = lk.getWsProviderPort();
Cxf download wsdl and xsd and check it. I want to turn this validation off. How can I do it?
Is there a way to do this with annotations?
Here is generated with wsdl class:
#WebServiceClient(name = "WsProviderService",
wsdlLocation = "file:/C:/src/lklB2B/lkB2B_ejb/src/main/resources/wsdl/test/lk_srv.wsdl",
targetNamespace = "http://south.rt.ru/WsProvider/")
public class WsProviderService extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://south.rt.ru/WsProvider/", "WsProviderService");
public final static QName WsProviderPort = new QName("http://south.rt.ru/WsProvider/", "WsProviderPort");
static {
URL url = null;
try {
url = new URL("file:/C:/src/lklB2B/lkB2B_ejb/src/main/resources/wsdl/test/lk_srv.wsdl");
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(WsProviderService.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "file:/C:/src/lklB2B/lkB2B_ejb/src/main/resources/wsdl/test/lk_srv.wsdl");
}
WSDL_LOCATION = url;
}
public WsProviderService(URL wsdlLocation) {
super(wsdlLocation, SERVICE);
}
public WsProviderService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public WsProviderService() {
super(WSDL_LOCATION, SERVICE);
}
public WsProviderService(WebServiceFeature ... features) {
super(WSDL_LOCATION, SERVICE, features);
}
public WsProviderService(URL wsdlLocation, WebServiceFeature ... features) {
super(wsdlLocation, SERVICE, features);
}
public WsProviderService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
super(wsdlLocation, serviceName, features);
}
Here is my part of my wsdl:
......
<wsdl:portType name="WsProviderPortType">
<wsdl:operation name="UpdateStatus">
<wsdl:input name="UpdateStatusRequest" message="tns:UpdateStatusRequest">
</wsdl:input>
<wsdl:output name="UpdateStatusResponse" message="tns:UpdateStatusResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="canCharge">
<wsdl:input name="canChargeRequest" message="tns:canChargeRequest"/>
<wsdl:output name="canChargeResponse" message="tns:canChargeResponse"/>
</wsdl:operation>
<wsdl:operation name="getOrder">
<wsdl:input name="getOrderRequest" message="tns:getOrderRequest">
</wsdl:input>
<wsdl:output name="getOrderResponse" message="tns:getOrderResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getAvailableSIMCardsList">
<wsdl:input name="getAvailableSIMCardsListRequest" message="tns:getAvailableSIMCardsListRequest">
</wsdl:input>
<wsdl:output name="getAvailableSIMCardsListResponse" message="tns:getAvailableSIMCardsListResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="updateOrderStatus">
<wsdl:input name="updateOrderStatusRequest" message="tns:updateOrderStatusRequest">
</wsdl:input>
<wsdl:output name="updateOrderStatusResponse" message="tns:updateOrderStatusResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="createOrderB2B">
<wsdl:input name="createOrderB2BRequest" message="tns:createOrderB2BRequest">
</wsdl:input>
<wsdl:output name="createOrderB2BResponse" message="tns:createOrderB2BResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="searchOrder">
<wsdl:input name="searchOrderRequest" message="tns:searchOrderRequest">
</wsdl:input>
<wsdl:output name="searchOrderResponse" message="tns:searchOrderResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="UpdateStatusLastMileCMS">
<wsdl:input name="UpdateStatusLastMileCMSRequest" message="tns:UpdateStatusLastMileCMSRequest">
</wsdl:input>
<wsdl:output name="UpdateStatusLastMileCMSResponse" message="tns:UpdateStatusLastMileCMSResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WsProviderServiceSoapBinding" type="tns:WsProviderPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="UpdateStatus">
<wsdl:input name="UpdateStatusRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="UpdateStatusResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="canCharge">
<wsdl:input name="canChargeRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="canChargeResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getOrder">
<wsdl:input name="getOrderRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getOrderResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getAvailableSIMCardsList">
<wsdl:input name="getAvailableSIMCardsListRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getAvailableSIMCardsListResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="updateOrderStatus">
<wsdl:input name="updateOrderStatusRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="updateOrderStatusResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="createOrderB2B">
<wsdl:input name="createOrderB2BRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="createOrderB2BResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="searchOrder">
<wsdl:input name="searchOrderRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="searchOrderResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="UpdateStatusLastMileCMS">
<wsdl:input name="UpdateStatusLastMileCMSRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="UpdateStatusLastMileCMSResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WsProviderService">
<wsdl:port name="WsProviderPort" binding="tns:WsProviderServiceSoapBinding">
<soap:address location="http://lkdevel2.south.rt.ru/wsp/soap/wsprovider/lk_srv"/>
</wsdl:port>
</wsdl:service>
Here is my pom:
</dependencies>
<properties>
<cxf-version>3.1.8</cxf-version>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.1</ejbVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>test</id>
<dependencies>
<dependency>
<groupId>ru.rt.mdm</groupId>
<artifactId>fw_ejb</artifactId>
<version>${mdm.fw.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.1.8</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
${basedir}/src/main/resources/wsdl/test/newordernotificationb2b_client_ep.wsdl
</wsdl>
<extraargs>
<extraarg>-p</extraarg>
<extraarg>http://result.general.rt.ru=ru.rt.general.result.mrf.center
</extraarg>
<extraarg>-p</extraarg>
<extraarg>
http://problem.result.general.rt.ru=ru.rt.general.result.mrf.center.problem
</extraarg>
</extraargs>
</wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/test/wsAttachment.wsdl</wsdl>
</wsdlOption>-->
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<cxf-version>3.1.8</cxf-version>
<mdm.fw.version>3.0</mdm.fw.version>
<mdm.domain.jar>domain-3.0.jar</mdm.domain.jar>
<service.login>testLogin</service.login>
<service.password>testPass</service.password>
</properties>
</profile>
</profiles>
The one of the solution was to add BindingProvider in the Service class and set endpoint settings in getRequestContext() method :
BindingProvider bp = (BindingProvider) lkService;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, AppConfig.getConfig().getProperty("lk.service"));
I have two request messages generated by gSOAP library:
1
POST http://localhost:8998/Service1.svc/ HTTP/1.1
Host: localhost:8998
User-Agent: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8; action="http://tempuri.org/IService1/GetData"
Content-Length: 536
Connection: close
SOAPAction: "http://tempuri.org/IService1/GetData"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns4="http://schemas.datacontract.org/2004/07/WcfService2" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Body><ns1:GetData><ns1:value>55</ns1:value></ns1:GetData></SOAP-ENV:Body></SOAP-ENV:Envelope>
2
POST http://localhost:8998/Service1.svc/ HTTP/1.1
Host: localhost:8998
User-Agent: gSOAP/2.8
Content-Type: text/xml; charset=utf-8
Content-Length: 538
Connection: close
SOAPAction: "http://tempuri.org/IService1/GetData"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns4="http://schemas.datacontract.org/2004/07/WcfService2" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Body><ns1:GetData><ns1:value>55</ns1:value></ns1:GetData></SOAP-ENV:Body></SOAP-ENV:Envelope>
What kind of messages they are SOAP 1.1 or SOAP 1.2 ?
First message was formated by proxy class that was generated by wsdl2h and soapcpp2 by default. This message request failes. Second message was generated by proxy with changed namespace inside of it:
from
{"SOAP-ENV", "http://www.w3.org/2003/05/soap-envelope", "http://schemas.xmlsoap.org/soap/envelope/", NULL},
to
{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/","http://schemas.xmlsoap.org/soap/envelope/",NULL},
And it works fine. Why I need to change namespace to make it work? Why gSOAP tools can't generate correct namespace?
WSDL:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" name="Service1" targetNamespace="http://tempuri.org/">
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://localhost:8998/Service1.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="http://localhost:8998/Service1.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="http://localhost:8998/Service1.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/WcfService2"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="IService1_GetData_InputMessage">
<wsdl:part name="parameters" element="tns:GetData"/>
</wsdl:message>
<wsdl:message name="IService1_GetData_OutputMessage">
<wsdl:part name="parameters" element="tns:GetDataResponse"/>
</wsdl:message>
<wsdl:message name="IService1_GetDataUsingDataContract_InputMessage">
<wsdl:part name="parameters" element="tns:GetDataUsingDataContract"/>
</wsdl:message>
<wsdl:message name="IService1_GetDataUsingDataContract_OutputMessage">
<wsdl:part name="parameters" element="tns:GetDataUsingDataContractResponse"/>
</wsdl:message>
<wsdl:portType name="IService1">
<wsdl:operation name="GetData">
<wsdl:input wsaw:Action="http://tempuri.org/IService1/GetData" message="tns:IService1_GetData_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IService1/GetDataResponse" message="tns:IService1_GetData_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="GetDataUsingDataContract">
<wsdl:input wsaw:Action="http://tempuri.org/IService1/GetDataUsingDataContract" message="tns:IService1_GetDataUsingDataContract_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IService1/GetDataUsingDataContractResponse" message="tns:IService1_GetDataUsingDataContract_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IService1" type="tns:IService1">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetData">
<soap:operation soapAction="http://tempuri.org/IService1/GetData" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetDataUsingDataContract">
<soap:operation soapAction="http://tempuri.org/IService1/GetDataUsingDataContract" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Service1">
<wsdl:port name="BasicHttpBinding_IService1" binding="tns:BasicHttpBinding_IService1">
<soap:address location="http://localhost:8998/Service1.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
This helpful SO post states that SOAP 1.1 uses this namespace:
http://schemas.xmlsoap.org/soap/envelope/
while SOAP 1.2 uses this namespace:
http://www.w3.org/2003/05/soap-envelope
Your first message appears therefore to be from SOAP 1.2, while your second message appears to be from SOAP 1.1. Since your first message is failing, and the second passes, it would seem that you are using a SOAP 1.1 compliant service.
A lot of times you can know that the version of SOAP request is 1.2, when you see
Content-Type: application/soap+xml; charset=utf-8; action="address"
SOAP 1.1 uses Content-Type: text/xml; charset=utf-8
I'm attempting to create user accounts for a vendor tool in batches. I asked the vendor how to turn on the MEX for the endpoint for creating a single account and I adjusted the config file accordingly.
I was able to create a service reference, but all I have in Visual Studio is a client and two interfaces. I can't tell how to create a request. The client has an InvokeService method, but it just takes an object.
I replicated the vendors class structure in my code, but then the service didn't like my type. So, I updated the classes to use the vendor's original namespace, but the service still didn't like it.
Type 'life.businessService.baseBusinessDataModel.BusinessRequest' with data contract name 'BusinessRequest:http://schemas.datacontract.org/2004/07/life.businessService.baseBusinessDataModel' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
Here's the WSDL from the service. I'm not very strong in WCF, so I'm hoping for some guidance. Thanks!
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ClientWcfBusinessFacadeService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsp:Policy wsu:Id="NetNamedPipeBinding_IWcfBusinessFacade_policy">
<wsp:ExactlyOne>
<wsp:All>
<msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1">
</msb:BinaryEncoding>
<wsaw:UsingAddressing>
</wsaw:UsingAddressing>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsp:Policy wsu:Id="NetTcpBinding_IWcfBusinessFacade_policy">
<wsp:ExactlyOne>
<wsp:All>
<msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1">
</msb:BinaryEncoding>
<wsaw:UsingAddressing>
</wsaw:UsingAddressing>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import namespace="http://tempuri.org/" />
<xsd:import namespace="http://schemas.datacontract.org/2004/07/life.common.serviceCommon" />
<xsd:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="IWcfBusinessFacade_InvokeService_InputMessage">
<wsdl:part name="parameters" element="tns:InvokeService" />
</wsdl:message>
<wsdl:message name="IWcfBusinessFacade_InvokeService_OutputMessage">
<wsdl:part name="parameters" element="tns:InvokeServiceResponse" />
</wsdl:message>
<wsdl:message name="IWcfBusinessFacade_InvokeService_ServiceFaultFault_FaultMessage">
<wsdl:part xmlns:q1="http://schemas.datacontract.org/2004/07/life.common.serviceCommon" name="detail" element="q1:ServiceFault" />
</wsdl:message>
<wsdl:portType name="IWcfBusinessFacade">
<wsdl:operation name="InvokeService">
<wsdl:input wsaw:Action="http://tempuri.org/IWcfBusinessFacade/InvokeService" message="tns:IWcfBusinessFacade_InvokeService_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IWcfBusinessFacade/InvokeServiceResponse" message="tns:IWcfBusinessFacade_InvokeService_OutputMessage" />
<wsdl:fault wsaw:Action="http://tempuri.org/IWcfBusinessFacade/InvokeServiceServiceFaultFault" name="ServiceFaultFault" message="tns:IWcfBusinessFacade_InvokeService_ServiceFaultFault_FaultMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NetNamedPipeBinding_IWcfBusinessFacade" type="tns:IWcfBusinessFacade">
<wsp:PolicyReference URI="#NetNamedPipeBinding_IWcfBusinessFacade_policy">
</wsp:PolicyReference>
<soap12:binding transport="http://schemas.microsoft.com/soap/named-pipe" />
<wsdl:operation name="InvokeService">
<soap12:operation soapAction="http://tempuri.org/IWcfBusinessFacade/InvokeService" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
<wsdl:fault name="ServiceFaultFault">
<soap12:fault use="literal" name="ServiceFaultFault" namespace="" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="NetTcpBinding_IWcfBusinessFacade" type="tns:IWcfBusinessFacade">
<wsp:PolicyReference URI="#NetTcpBinding_IWcfBusinessFacade_policy">
</wsp:PolicyReference>
<soap12:binding transport="http://schemas.microsoft.com/soap/tcp" />
<wsdl:operation name="InvokeService">
<soap12:operation soapAction="http://tempuri.org/IWcfBusinessFacade/InvokeService" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
<wsdl:fault name="ServiceFaultFault">
<soap12:fault use="literal" name="ServiceFaultFault" namespace="" />
<soap12:fault use="literal" name="ServiceFaultFault" namespace="" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ClientWcfBusinessFacadeService">
<wsdl:port name="NetNamedPipeBinding_IWcfBusinessFacade" binding="tns:NetNamedPipeBinding_IWcfBusinessFacade">
<soap12:address location="net.pipe://localhost/WcfBusinessFacadeService" />
<wsa10:EndpointReference>
<wsa10:Address>net.pipe://localhost/WcfBusinessFacadeService</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
<wsdl:port name="NetTcpBinding_IWcfBusinessFacade" binding="tns:NetTcpBinding_IWcfBusinessFacade">
<soap12:address location="net.tcp://localhost:8086/WcfBusinessFacadeService" />
<wsa10:EndpointReference>
<wsa10:Address>net.tcp://localhost:8086/WcfBusinessFacadeService</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
<wsdl:port name="NetTcpBinding_IWcfBusinessFacade1" binding="tns:NetTcpBinding_IWcfBusinessFacade">
<soap12:address location="net.tcp://localhost:10000/WcfBusinessFacadeService" />
<wsa10:EndpointReference>
<wsa10:Address>net.tcp://localhost:10000/WcfBusinessFacadeService</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
For the input message of the InvokeService method, you need to pass the object defined in tns:InvokeService. It will be a type in namespace http://tempuri.org/Imports, but is not explicitly exposed in this WSDL; it is coming from another namespace. You may ask the vendor for the schema XSD or assembly from which this WSDL is expecting to import types below since no absolute or even relative schemaLocation attribute is included
<xsd:import namespace="http://tempuri.org/" />
<xsd:import namespace="http://schemas.datacontract.org/2004/07/life.common.serviceCommon" />
I have an existing WCF service that works. I've added a reference in Visual Studio 2010 for my Windows Phone app. The reference shows up and I see the methods when I check out the properties of it. The service is using basicHttpBinding. It seems the proxy class is never generated. I cannot reference it (yes - I'm checking the proper namespace)
I'm aware of the SlSvcUtil.exe utility - but that is supposed to not be necessary anymore. Any thoughts as to why my proxy class isn't being generated but the service reference is there?
Thanks!
EDIT: Wsdl file is as follows:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ProjectManager" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://somesite/ProjectManager/ProjectManager.svc?xsd=xsd0" namespace="http://tempuri.org/" />
<xsd:import schemaLocation="http://somesite/ProjectManager/ProjectManager.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
<xsd:import schemaLocation="http://somesite/ProjectManager/ProjectManager.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/ProjectManager" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="IProjectManagerService_GetProjectList_InputMessage">
<wsdl:part name="parameters" element="tns:GetProjectList" />
</wsdl:message>
<wsdl:message name="IProjectManagerService_GetProjectList_OutputMessage">
<wsdl:part name="parameters" element="tns:GetProjectListResponse" />
</wsdl:message>
<wsdl:message name="IProjectManagerService_GetProjectFiles_InputMessage">
<wsdl:part name="parameters" element="tns:GetProjectFiles" />
</wsdl:message>
<wsdl:message name="IProjectManagerService_GetProjectFiles_OutputMessage">
<wsdl:part name="parameters" element="tns:GetProjectFilesResponse" />
</wsdl:message>
<wsdl:portType name="IProjectManagerService">
<wsdl:operation name="GetProjectList">
<wsdl:input wsaw:Action="http://tempuri.org/IProjectManagerService/GetProjectList" message="tns:IProjectManagerService_GetProjectList_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IProjectManagerService/GetProjectListResponse" message="tns:IProjectManagerService_GetProjectList_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="GetProjectFiles">
<wsdl:input wsaw:Action="http://tempuri.org/IProjectManagerService/GetProjectFiles" message="tns:IProjectManagerService_GetProjectFiles_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IProjectManagerService/GetProjectFilesResponse" message="tns:IProjectManagerService_GetProjectFiles_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IProjectManagerService" type="tns:IProjectManagerService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetProjectList">
<soap:operation soapAction="http://tempuri.org/IProjectManagerService/GetProjectList" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetProjectFiles">
<soap:operation soapAction="http://tempuri.org/IProjectManagerService/GetProjectFiles" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ProjectManager">
<wsdl:port name="BasicHttpBinding_IProjectManagerService" binding="tns:BasicHttpBinding_IProjectManagerService">
<soap:address location="http://somesite/ProjectManager/ProjectManager.svc" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
This has happened to me.
Not sure what causes it.
What works for me is to close down Visual Studio, reopen, right click on the service and click Update Service Reference.
I got exactly the same problem. And installing the "Windows Phone Developer Tools Fix" solved the problem.
Here is the link to download the fix: http://download.microsoft.com/download/6/D/6/6D66958D-891B-4C0E-BC32-2DFC41917B11/VS10-KB2486994-x86.exe
Good luck!
I had this problem.
Adding the service again with another name solved the problem for me once or twice.
Slsvc works every time and is much nicer to work with when checking into TFS.
Not sure if this is TFS related or not.
Oddly enough - a month later it started working with no other installs. Its possible that a recent reboot 'fixed' it but thought I had rebooted prior as well - who knows though. Either way its working.