I have my server hosting my WSDL on an app server. I'm able to access the service and use the methods when running locally off my own IP address. But when running on our app server I can only access the WSDL, reference it and view the methods it has, but not use the methods. I'm running it as a console application in VB.NET 4.0. I get an InternalServiceFault.
Public Class pokeWCF
Implements poke
Dim objFile As String = "C:\Users\lsj\Documents\Visual Studio 2012\Projects\ConsoleServer\easyA.txt"
Dim aryText() As String
Dim sK As String
Dim fM As String
Dim msg As String
Dim time As DateTime = DateTime.Now
Dim format As String = "ddd d HH:mm yyyy"
Dim OracleReceive As New ReceiveOrcl
Public Function backTo(securityKey As String, from As String, message As String) As ServiceResult Implements poke.backTo
'stuff
End Function
Public Function Test(securityKey As String) As ServiceResult Implements poke.Test
'moreStuff
End Function
End Class
Sub Main()
Dim strHostName As String
Dim strIPAddress As String
strHostName = System.Net.Dns.GetHostName()
strIPAddress = System.Net.Dns.GetHostByName(strHostName).AddressList(0).ToString()
MsgBox(strIPAddress.ToString)
Dim url As Uri = New Uri("http://" & strIPAddress & ":22380/poke")
Dim host As New ServiceHost(GetType(pokeWCF), url)
Dim smb As New ServiceMetadataBehavior()
Console.WriteLine("CRAB BATTLE!")
Console.Write("Server Up" & vbCrLf)
smb.HttpGetEnabled = True
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15
host.Description.Behaviors.Add(smb)
host.Open()
Console.WriteLine("Running at " & url.ToString)
Console.Read()
End Sub
After looking over the WSDLs generated from the app server and my localhost vary in their definitions.
Edit:
Locally generated WSDL:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 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:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://www.w3.org/ns/ws-policy" 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="RacoSMSWCF" targetNamespace="http://tempuri.org/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<xs:import namespace="https://t-mobile.racowireless.com/SMSRicochet1.0"/>
<xs:element name="ReceiveSMS">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="securityKey" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="from" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ReceiveSMSResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q1="https://t-mobile.racowireless.com/SMSRicochet1.0" minOccurs="0" name="ReceiveSMSResult" type="q1:ServiceResult"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Test">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="securityKey" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TestResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q2="https://t-mobile.racowireless.com/SMSRicochet1.0" minOccurs="0" name="TestResult" type="q2:ServiceResult"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:element name="anyType" nillable="true" type="xs:anyType"/>
<xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
<xs:element name="boolean" nillable="true" type="xs:boolean"/>
<xs:element name="byte" nillable="true" type="xs:byte"/>
<xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
<xs:element name="decimal" nillable="true" type="xs:decimal"/>
<xs:element name="double" nillable="true" type="xs:double"/>
<xs:element name="float" nillable="true" type="xs:float"/>
<xs:element name="int" nillable="true" type="xs:int"/>
<xs:element name="long" nillable="true" type="xs:long"/>
<xs:element name="QName" nillable="true" type="xs:QName"/>
<xs:element name="short" nillable="true" type="xs:short"/>
<xs:element name="string" nillable="true" type="xs:string"/>
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
<xs:element name="char" nillable="true" type="tns:char"/>
<xs:simpleType name="char">
<xs:restriction base="xs:int"/>
</xs:simpleType>
<xs:element name="duration" nillable="true" type="tns:duration"/>
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="guid" nillable="true" type="tns:guid"/>
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute name="FactoryType" type="xs:QName"/>
<xs:attribute name="Id" type="xs:ID"/>
<xs:attribute name="Ref" type="xs:IDREF"/>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="https://t-mobile.racowireless.com/SMSRicochet1.0" elementFormDefault="qualified" targetNamespace="https://t-mobile.racowireless.com/SMSRicochet1.0">
<xs:simpleType name="ServiceResult">
<xs:restriction base="xs:string">
<xs:enumeration value="ACCEPTED"/>
<xs:enumeration value="MESSAGE_TOO_LONG"/>
<xs:enumeration value="INVALID_CREDENTIALS"/>
<xs:enumeration value="REJECTED"/>
<xs:enumeration value="NOTFOUND"/>
<xs:enumeration value="INVALID_RECIPIENT"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="ServiceResult" nillable="true" type="tns:ServiceResult"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="racoSMS_ReceiveSMS_InputMessage">
<wsdl:part name="parameters" element="tns:ReceiveSMS"/>
</wsdl:message>
<wsdl:message name="racoSMS_ReceiveSMS_OutputMessage">
<wsdl:part name="parameters" element="tns:ReceiveSMSResponse"/>
</wsdl:message>
<wsdl:message name="racoSMS_Test_InputMessage">
<wsdl:part name="parameters" element="tns:Test"/>
</wsdl:message>
<wsdl:message name="racoSMS_Test_OutputMessage">
<wsdl:part name="parameters" element="tns:TestResponse"/>
</wsdl:message>
<wsdl:portType name="racoSMS">
<wsdl:operation name="ReceiveSMS">
<wsdl:input wsam:Action="http://tempuri.org/racoSMS/ReceiveSMS" message="tns:racoSMS_ReceiveSMS_InputMessage"/>
<wsdl:output wsam:Action="http://tempuri.org/racoSMS/ReceiveSMSResponse" message="tns:racoSMS_ReceiveSMS_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="Test">
<wsdl:input wsam:Action="http://tempuri.org/racoSMS/Test" message="tns:racoSMS_Test_InputMessage"/>
<wsdl:output wsam:Action="http://tempuri.org/racoSMS/TestResponse" message="tns:racoSMS_Test_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_racoSMS" type="tns:racoSMS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ReceiveSMS">
<soap:operation soapAction="http://tempuri.org/racoSMS/ReceiveSMS" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Test">
<soap:operation soapAction="http://tempuri.org/racoSMS/Test" 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="RacoSMSWCF">
<wsdl:port name="BasicHttpBinding_racoSMS" binding="tns:BasicHttpBinding_racoSMS">
<soap:address location="http://192.168.100.88:22380/racoSMS"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
App Server WSDL:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" name="RacoSMSWCF" targetNamespace="http://tempuri.org/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<xs:import namespace="https://t-mobile.racowireless.com/SMSRicochet1.0"/>
<xs:element name="ReceiveSMS">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="securityKey" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="from" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ReceiveSMSResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q1="https://t-mobile.racowireless.com/SMSRicochet1.0" minOccurs="0" name="ReceiveSMSResult" type="q1:ServiceResult"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Test">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="securityKey" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TestResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q2="https://t-mobile.racowireless.com/SMSRicochet1.0" minOccurs="0" name="TestResult" type="q2:ServiceResult"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:element name="anyType" nillable="true" type="xs:anyType"/>
<xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
<xs:element name="boolean" nillable="true" type="xs:boolean"/>
<xs:element name="byte" nillable="true" type="xs:byte"/>
<xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
<xs:element name="decimal" nillable="true" type="xs:decimal"/>
<xs:element name="double" nillable="true" type="xs:double"/>
<xs:element name="float" nillable="true" type="xs:float"/>
<xs:element name="int" nillable="true" type="xs:int"/>
<xs:element name="long" nillable="true" type="xs:long"/>
<xs:element name="QName" nillable="true" type="xs:QName"/>
<xs:element name="short" nillable="true" type="xs:short"/>
<xs:element name="string" nillable="true" type="xs:string"/>
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
<xs:element name="char" nillable="true" type="tns:char"/>
<xs:simpleType name="char">
<xs:restriction base="xs:int"/>
</xs:simpleType>
<xs:element name="duration" nillable="true" type="tns:duration"/>
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="guid" nillable="true" type="tns:guid"/>
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute name="FactoryType" type="xs:QName"/>
<xs:attribute name="Id" type="xs:ID"/>
<xs:attribute name="Ref" type="xs:IDREF"/>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="https://t-mobile.racowireless.com/SMSRicochet1.0" elementFormDefault="qualified" targetNamespace="https://t-mobile.racowireless.com/SMSRicochet1.0">
<xs:simpleType name="ServiceResult">
<xs:restriction base="xs:string">
<xs:enumeration value="ACCEPTED"/>
<xs:enumeration value="MESSAGE_TOO_LONG"/>
<xs:enumeration value="INVALID_CREDENTIALS"/>
<xs:enumeration value="REJECTED"/>
<xs:enumeration value="NOTFOUND"/>
<xs:enumeration value="INVALID_RECIPIENT"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="ServiceResult" nillable="true" type="tns:ServiceResult"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="racoSMS_ReceiveSMS_InputMessage">
<wsdl:part name="parameters" element="tns:ReceiveSMS"/>
</wsdl:message>
<wsdl:message name="racoSMS_ReceiveSMS_OutputMessage">
<wsdl:part name="parameters" element="tns:ReceiveSMSResponse"/>
</wsdl:message>
<wsdl:message name="racoSMS_Test_InputMessage">
<wsdl:part name="parameters" element="tns:Test"/>
</wsdl:message>
<wsdl:message name="racoSMS_Test_OutputMessage">
<wsdl:part name="parameters" element="tns:TestResponse"/>
</wsdl:message>
<wsdl:portType name="racoSMS">
<wsdl:operation name="ReceiveSMS">
<wsdl:input wsam:Action="http://tempuri.org/racoSMS/ReceiveSMS" message="tns:racoSMS_ReceiveSMS_InputMessage"/>
<wsdl:output wsam:Action="http://tempuri.org/racoSMS/ReceiveSMSResponse" message="tns:racoSMS_ReceiveSMS_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="Test">
<wsdl:input wsam:Action="http://tempuri.org/racoSMS/Test" message="tns:racoSMS_Test_InputMessage"/>
<wsdl:output wsam:Action="http://tempuri.org/racoSMS/TestResponse" message="tns:racoSMS_Test_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_racoSMS" type="tns:racoSMS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ReceiveSMS">
<soap:operation soapAction="http://tempuri.org/racoSMS/ReceiveSMS" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Test">
<soap:operation soapAction="http://tempuri.org/racoSMS/Test" 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="RacoSMSWCF">
<wsdl:port name="BasicHttpBinding_racoSMS" binding="tns:BasicHttpBinding_racoSMS">
<soap:address location="http://192.168.200.27:22380/racoSMS"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Edit:
Having discovered WCF Test Client from I got this error after testing my service running on the server.
The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at racoSMS.Test(String securityKey)
at racoSMSClient.Test(String securityKey)
You have created the ServiceHost and set up a ServiceMetadataBehavior with HttpGetEnabled so that the service WSDL can be accessed at the address http://?wsdl. It looks like the only thing missing is the endpoints that need to be added to the ServiceHost.
You can add endpoints with the following syntax:
host.AddServiceEndpoint(GetType([ServiceContractType]), [binding], "[url]");
The ServiceContract type should be implemented by your service class (it's often an interface and looks like it's "poke" in this case).
There are many bindings available (more info here), and what you use will depend on what kinds of clients you want to support and what kind of features you want to provide (security, reliability, transactions, etC). BasicHttpBinding is the most backward-compatible and will work with anything that conforms to the WS-I Basic Profile specification.
The url you provide in the endpoint will be appended to the base url you provided to the ServiceHost when that object was created.
Related
WSDL service was created using ASP.Net Core 2.1
When I add reference to WCF service I get error message:
Metadata not available
Failed to get metadata from "http://xxx.xxx.xxx.xxx:port/somewsdl?wsdl".
(Microsoft.BizTalk.Adapter.Wcf.Consuming.MetadataExchange.MetadataExchangeException) Unable to download metadata from "http://xxx.xxx.xxx.xxx:port/somewsdl??wsdl" using WS-Metadata Exchange.
(System.InvalidOperationException) Metadata contains a reference that cannot be resolved: 'http://xxx.xxx.xxx.xxx:port/somewsdl??wsdl'. (System.ServiceModel.CommunicationException)
The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\somedll.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
When I tested wsdl from SoapUI, it works. Can you help me please?
VS 2010 Ultimate version 10.0.30319.1
BizTalk Server 2010 version 3.9.469.0
I did a test to make sure it wasn't a problem with the old VS / BizTalk:
VS 2015 Professional
BizTalk Server 2016
-------------- Edited ---------------------
I am adding a reference by using:
When I am using "Metadata files" in "BizTalk WCF service consuming wizard" then I get error:
wsdl file:
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" targetNamespace="http://tempuri.org/" name="ISomeImport" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xs:import namespace="http://schemas.datacontract.org/2004/07/System"/>
<xs:element name="InputData">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="template" type="tns:FormTemplateType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InputDataResponse">
<xs:element minOccurs="0" maxOccurs="1" name="InputDataResult" type="tns:FormTemplateResponseType"/>
</xs:element>
<xs:complexType name="FormTemplateType">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Changed" type="xs:dateTime"/>
<xs:element minOccurs="0" maxOccurs="1" name="Data" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="Gestor" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="Identifier" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="Publisher" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="Status" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="Version" type="tns:FormTemplteVersion"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="FormTemplateResponseType">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Code" type="xs:int"/>
<xs:element minOccurs="0" maxOccurs="1" name="Message" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="TimestampStart" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="TimestampEnd" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="FormTemplteVersion">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Major" type="xs:int"/>
<xs:element minOccurs="1" maxOccurs="1" name="Minor" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="ISomeImport_InputData_InputMessage">
<wsdl:part name="parameters" element="tns:InputData"/>
</wsdl:message>
<wsdl:message name="ISomeImport_InputData_OutputMessage">
<wsdl:part name="parameters" element="tns:FormTemplateResponseType"/>
</wsdl:message>
<wsdl:portType name="ISomeImport">
<wsdl:operation name="InputData">
<wsdl:input message="tns:ISomeImport_InputData_InputMessage"/>
<wsdl:output message="tns:ISomeImport_InputData_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding" type="tns:ISomeImport">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="InputData">
<soap:operation soapAction="http://tempuri.org/ISomeImport/InputData" 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="ISomeImport">
<wsdl:port name="BasicHttpBinding" binding="tns:BasicHttpBinding">
<soap:address location="http://xxx.xxx.xxx.xxx:port/someImport"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Try to browse you WSDL file from the browser, save it locally.And on the WCF Service Consuming Wizard choose the downloaded wsdl file. It should works.
have a lConsume web service using Wcf-basichttp adapter
Problem was in wsdl.
New wsdl:
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/" name="IsomeImport">
<script/>
<script/>
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<xs:import namespace="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces"/>
<xs:element name="InputData">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces" minOccurs="0" name="template" nillable="true" type="q1:EFormTemplateType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InputDataResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces" minOccurs="0" name="InputDataResult" nillable="true" type="q2:EFormTemplateResponseType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:element name="anyType" nillable="true" type="xs:anyType"/>
<xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
<xs:element name="boolean" nillable="true" type="xs:boolean"/>
<xs:element name="byte" nillable="true" type="xs:byte"/>
<xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
<xs:element name="decimal" nillable="true" type="xs:decimal"/>
<xs:element name="double" nillable="true" type="xs:double"/>
<xs:element name="float" nillable="true" type="xs:float"/>
<xs:element name="int" nillable="true" type="xs:int"/>
<xs:element name="long" nillable="true" type="xs:long"/>
<xs:element name="QName" nillable="true" type="xs:QName"/>
<xs:element name="short" nillable="true" type="xs:short"/>
<xs:element name="string" nillable="true" type="xs:string"/>
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
<xs:element name="char" nillable="true" type="tns:char"/>
<xs:simpleType name="char">
<xs:restriction base="xs:int"/>
</xs:simpleType>
<xs:element name="duration" nillable="true" type="tns:duration"/>
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="guid" nillable="true" type="tns:guid"/>
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute name="FactoryType" type="xs:QName"/>
<xs:attribute name="Id" type="xs:ID"/>
<xs:attribute name="Ref" type="xs:IDREF"/>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/someeFormFiller.Models.Interfaces">
<xs:import namespace="http://schemas.datacontract.org/2004/07/System"/>
<xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xs:complexType xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" name="EFormTemplateType">
<xs:sequence>
<xs:element minOccurs="0" name="Changed" type="xs:dateTime"/>
<xs:element minOccurs="0" name="Data" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Gestor" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Identifier" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Publisher" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Status" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Version" nillable="true" type="tns:EFormTemplateVersion"/>
</xs:sequence>
</xs:complexType>
<xs:element name="EFormTemplateType" nillable="true" type="tns:EFormTemplateType"/>
<xs:complexType xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" name="EFormTemplateVersion">
<xs:sequence>
<xs:element minOccurs="0" name="Major" type="xs:int"/>
<xs:element minOccurs="0" name="Minor" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:element name="EFormTemplateVersion" nillable="true" type="tns:EFormTemplateVersion"/>
<xs:complexType xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" name="EFormTemplateResponseType">
<xs:sequence>
<xs:element minOccurs="0" name="Code" type="xs:int"/>
<xs:element minOccurs="0" name="Message" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="TimestampEnd" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="TimestampStart" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="EFormTemplateResponseType" nillable="true" type="tns:EFormTemplateResponseType"/>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="IsomeImport_InputData_InputMessage">
<wsdl:part name="parameters" element="tns:InputData"/>
</wsdl:message>
<wsdl:message name="IsomeImport_InputData_OutputMessage">
<wsdl:part name="parameters" element="tns:InputDataResponse"/>
</wsdl:message>
<wsdl:portType name="IsomeImport">
<wsdl:operation name="InputData">
<wsdl:input wsam:Action="http://tempuri.org/IsomeImport/InputData" message="tns:IsomeImport_InputData_InputMessage"/>
<wsdl:output wsam:Action="http://tempuri.org/IsomeImport/InputDataResponse" message="tns:IsomeImport_InputData_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding" type="tns:IsomeImport">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="InputData">
<soap:operation soapAction="http://tempuri.org/IsomeImport/InputData" 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="IsomeImport">
<wsdl:port name="BasicHttpBinding" binding="tns:BasicHttpBinding">
<soap:address location="http://xxx.xxx.xxx.xxx:port/someImport.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I have a WSDL . Following WSDL i am trying to try in SoapUI
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" name="NextGenService" targetNamespace="">
<wsp:Policy wsu:Id="DocumentExchangePort_policy">...</wsp:Policy>
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/Message" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Message">
<xs:simpleType name="StreamBody">
<xs:restriction base="xs:base64Binary"/>
</xs:simpleType>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:import namespace="http://schemas.microsoft.com/Message"/>
<xs:import namespace="http://schemas.datacontract.org/2004/07/SupportingDocsFacade"/>
<xs:element name="RemoteFileInfo">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q1="http://schemas.microsoft.com/Message" name="FileByteStream" type="q1:StreamBody"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/SupportingDocsFacade" name="dcExhange" nillable="true" type="q2:DocumentExchangeRequests"/>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:element name="anyType" nillable="true" type="xs:anyType"/>
<xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
<xs:element name="boolean" nillable="true" type="xs:boolean"/>
<xs:element name="byte" nillable="true" type="xs:byte"/>
<xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
<xs:element name="decimal" nillable="true" type="xs:decimal"/>
<xs:element name="double" nillable="true" type="xs:double"/>
<xs:element name="float" nillable="true" type="xs:float"/>
<xs:element name="int" nillable="true" type="xs:int"/>
<xs:element name="long" nillable="true" type="xs:long"/>
<xs:element name="QName" nillable="true" type="xs:QName"/>
<xs:element name="short" nillable="true" type="xs:short"/>
<xs:element name="string" nillable="true" type="xs:string"/>
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
<xs:element name="char" nillable="true" type="tns:char"/>
<xs:simpleType name="char">
<xs:restriction base="xs:int"/>
</xs:simpleType>
<xs:element name="duration" nillable="true" type="tns:duration"/>
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="guid" nillable="true" type="tns:guid"/>
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute name="FactoryType" type="xs:QName"/>
<xs:attribute name="Id" type="xs:ID"/>
<xs:attribute name="Ref" type="xs:IDREF"/>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/SupportingDocsFacade" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/SupportingDocsFacade">
<xs:complexType name="DocumentExchangeRequests">
<xs:sequence>
<xs:element name="_documentDescription" nillable="true" type="tns:DescriptionSet"/>
<xs:element name="_loanIdentifier" nillable="true" type="tns:LoanFileIdentifier"/>
</xs:sequence>
</xs:complexType>
<xs:element name="DocumentExchangeRequests" nillable="true" type="tns:DocumentExchangeRequests"/>
<xs:complexType name="DescriptionSet">
<xs:sequence>
<xs:element name="_documentType" nillable="true" type="xs:string"/>
<xs:element name="_x003C_ByteCount_x003E_k__BackingField" nillable="true" type="xs:string"/>
<xs:element name="_x003C_DocumentCreated_x003E_k__BackingField" nillable="true" type="xs:string"/>
<xs:element name="_x003C_DocumentDescrption_x003E_k__BackingField" nillable="true" type="xs:string"/>
<xs:element name="_x003C_DocumentID_x003E_k__BackingField" nillable="true" type="xs:string"/>
<xs:element name="_x003C_PageCount_x003E_k__BackingField" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="DescriptionSet" nillable="true" type="tns:DescriptionSet"/>
<xs:complexType name="LoanFileIdentifier">
<xs:sequence>
<xs:element name="_x003C_ApplyOnlineID_x003E_k__BackingField" nillable="true" type="xs:string"/>
<xs:element name="_x003C_BrokerID_x003E_k__BackingField" nillable="true" type="xs:string"/>
<xs:element name="_x003C_DocumentID_x003E_k__BackingField" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="LoanFileIdentifier" nillable="true" type="tns:LoanFileIdentifier"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="RemoteFileInfo">
<wsdl:part name="parameters" element="RemoteFileInfo"/>
</wsdl:message>
<wsdl:message name="RemoteFileInfo_Headers">
<wsdl:part name="dcExhange" element="dcExhange"/>
</wsdl:message>
<wsdl:message name="INextGenService_UploadDocNextGen_OutputMessage"/>
<wsdl:portType name="INextGenService">
<wsdl:operation name="UploadDocNextGen">
<wsdl:input wsaw:Action="urn:INextGenService/UploadDocNextGen" name="RemoteFileInfo" message="RemoteFileInfo"/>
<wsdl:output wsaw:Action="urn:INextGenService/UploadDocNextGenResponse" message="INextGenService_UploadDocNextGen_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DocumentExchangePort" type="INextGenService">
<wsp:PolicyReference URI="#DocumentExchangePort_policy"/>
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="UploadDocNextGen">
<soap12:operation soapAction="urn:INextGenService/UploadDocNextGen" style="document"/>
<wsdl:input name="RemoteFileInfo">
<soap12:header message="RemoteFileInfo_Headers" part="dcExhange" use="literal"/>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NextGenService">
<wsdl:port name="DocumentExchangePort" binding="DocumentExchangePort">
<soap12:address location="https://l24-a0845.latrobe.biz/SupportingDocsFacade/NextGenService.svc/UploadDoc"/>
<wsa10:EndpointReference>
<wsa10:Address>
https://l24-a0845.latrobe.biz/SupportingDocsFacade/NextGenService.svc/UploadDoc
</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
The webconfig in server to generate the following looks like this
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WsBinding" messageEncoding="Mtom" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" transactionFlow="false" textEncoding="utf-8" >
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="NextGenServiceBehavior" name="SupportingDocsFacade.NextGenService">
<endpoint address="/UploadDoc" binding="wsHttpBinding" bindingConfiguration="WsBinding" name="Basic" contract="SupportingDocsFacade.INextGenService" />
</service>
</services>
<behavior name="NextGenServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
I wrote a client and is it is able to communicate with the service .
The issue came when i tried importing WSDL in SOAP UI
Following is the RemoteFileInfo class used for WCF service
public class RemoteFileInfo : IDisposable
{
[MessageHeader(MustUnderstand = true)]
public DocumentExchangeRequests dcExhange;
[MessageBodyMember]
public Stream FileByteStream;
public void Dispose()
{
if (FileByteStream != null)
{
FileByteStream.Close();
FileByteStream = null;
}
}
}
[Serializable]
[MessageContract]
public class DocumentExchangeRequests
{
private DescriptionSet _documentDescription = null;
private LoanFileIdentifier _loanIdentifier = null;
[DataMember(IsRequired = true)]
public DescriptionSet DocumentDescriptionset
{
get { return _documentDescription = this.DocumentDescriptionset; }
set { this.DocumentDescriptionset = value; }
}
[DataMember(IsRequired = true)]
public LoanFileIdentifier LoanIdentifier
{
get { return _loanIdentifier = this.LoanIdentifier; }
set { this.LoanIdentifier = value; }
}
}
[Serializable]
[MessageContract]
public class DescriptionSet
{
private string _documentType = "";
[DataMember(IsRequired = true)]
public string DocumentTypes
{
get { return _documentType = this.DocumentTypes; }
set { this.DocumentTypes = value; }
}
[DataMember(IsRequired = true)]
public string DocumentID { get; set; }
[DataMember(IsRequired = true)]
public string ByteCount { get; set; }
[DataMember(IsRequired = true)]
public string DocumentCreated { get; set; }
[DataMember(IsRequired = true)]
public string PageCount { get; set; }
[DataMember(IsRequired = true)]
public string DocumentDescrption { get; set; }
}
[Serializable]
[MessageContract]
public class LoanFileIdentifier
{
[DataMember(IsRequired = true, Order = 0, Name = "DocHeaderID")]
public string DocumentID { get; set; }
[DataMember(IsRequired = true, Order = 1, Name = "BrokerID")]
public string BrokerID { get; set; }
[DataMember(IsRequired = true, Order = 2, Name = "ApplyOnlineID")]
public string ApplyOnlineID { get; set; }
}
Any pointer on what is causing the issue . I have been cracking head over this for a week . Is this anything to do with the setting in soapUI or my WSDL itself is wrong ?
WSDL, web service description language, this file doesn’t contain data contract of the service, only XSD files contain the Data Contracts and WSDL has import directives for those XSD files.
Due to this dependency on other files, processing such these WSDL files by some third-party was impossible. Therefore WCF4.5 publish the service metadata by using a Single file. all WSDL information is returned in one single document including some other information.
In SOAPUI, we could use the SingleWSDL file to generate the project.
http://10.157.13.69:1100/Service1.svc?singleWsdl
The premise is that we enable metadata publishing via the Http or Https protocol.
Here is a helpful link, wish it is useful to you.
http://blogs.microsoft.co.il/idof/2011/09/17/whats-new-in-wcf-45-a-single-wsdl-file/
Feel free to let me know if there is anything I can help with.
[com.sun.istack.SAXParseException2; lineNumber: 1; columnNumber: 1; unexpected element (uri:"http://service.example.com/", local:"custDetails"). Expected elements are <{http://schemas.xmlsoap.org/soap/envelope/}Body>,<{}Customer>,<{http://schemas.xmlsoap.org/soap/envelope/}Envelope>,<{http://schemas.xmlsoap.org/soap/envelope/}Fault>,<{http://schemas.xmlsoap.org/soap/envelope/}Header>]
Problem statement: Camel is not expecting to receive the custDetails (webmethod) and the namespace.
Expectation : to use camel-soap to unmarshal the payload to soapJaxb out of the box.
Generated JAXB classes using maven-jaxb2-plugin for the xsd below. Results produced three classes with annotations - Customer.java, ObjectFactory,java , Order.java.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
>
<xs:element name="Customer">
<xs:complexType >
<xs:sequence>
<xs:element name="Id" type="xs:string"/>
<xs:element name="Address" type="xs:string"/>
<xs:element name="ListOfOrders" type="order" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="order">
<xs:sequence>
<xs:element name="Id" type="xs:string"/>
<xs:element name="ProductName" type="xs:string"/>
<xs:element name="ListOfDevice" minOccurs="0" >
<xs:complexType>
<xs:sequence>
<xs:element name="DeviceName" type="xs:string"/>
<xs:element name="ManufactureDate" type="xs:date"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
Expose webservice custDetails(..) as follows using cxf endpoint with DataFormat set to PAYLOAD. [UPDATED with #Configuration]
#Configuration
public class WebServiceConfig {
#Autowired
private Bus bus;
#Bean
public CxfEndpoint getCustomerDetails() {
CxfEndpoint cxfEndpoint = new CxfEndpoint();
cxfEndpoint.setAddress("/customerProvide");
cxfEndpoint.setServiceClass(CustomerSvc.class);
cxfEndpoint.setBus(bus);
cxfEndpoint.setDataFormat(DataFormat.PAYLOAD);return cxfEndpoint ;}
#Webservice
public interface CustomerSvc {
#WebMethod
Customer custDetails ( #WebParam(name="Customer")Customer Customer ) ;}
// Simple route in Route class.
#Component
public class CustomerRoute extends RouteBuilder {
public void configure (){
SoapJaxbDataFormat soapDF
= new SoapJaxbDataFormat("com.example.service", new TypeNameStrategy());
from("cxf:bean:getCustomerDetails").unmarshal(soapDF)
.log("receive : ${body}")
}
Wsdl generated and imported to soapUI. sample SOAPUI request to test is as follows.
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ser="http://service.example.com/">
<soapenv:Header/>
<soapenv:Body>
<ser:custDetails>
<ser:Customer>
<Id>1-abc</Id>
<Address>23 Sydney Oxley road</Address>
<ListOfOrders>
<Id>P1344</Id>
<ProductName>DRAM</ProductName>
<ListOfDevice>
<DeviceName>20nm</DeviceName>
<ManufactureDate>15-8-2017</ManufactureDate>
</ListOfDevice>
</ListOfOrders>
</ser:Customer>
</ser:custDetails>
</soapenv:Body>
</soapenv:Envelope>
When I try to unmarshal PAYLOAD with soap dataformat, camel is throwing an error. It is the hitting namespace error. I am not sure why package-info class is not generated. Any help is greatly appreciated. Thank you.
UPDATE, wsdl given below.
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://service.example.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="CustomerSvcService" targetNamespace="http://service.example.com/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://service.example.com/" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://service.example.com/">
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" type="xs:string"/>
<xs:element name="Address" type="xs:string"/>
<xs:element minOccurs="0" name="ListOfOrders" type="tns:order"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="order">
<xs:sequence>
<xs:element name="Id" type="xs:string"/>
<xs:element name="ProductName" type="xs:string"/>
<xs:element minOccurs="0" name="ListOfDevice">
<xs:complexType>
<xs:sequence>
<xs:element name="DeviceName" type="xs:string"/>
<xs:element name="ManufactureDate" type="xs:date"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="custDetails" type="tns:custDetails"/>
<xs:complexType name="custDetails">
<xs:sequence>
<xs:element minOccurs="0" ref="tns:Customer"/>
</xs:sequence>
</xs:complexType>
<xs:element name="custDetailsResponse" type="tns:custDetailsResponse"/>
<xs:complexType name="custDetailsResponse">
<xs:sequence>
<xs:element minOccurs="0" ref="tns:Customer"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="custDetails">
<wsdl:part element="tns:custDetails" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="custDetailsResponse">
<wsdl:part element="tns:custDetailsResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="CustomerSvc">
<wsdl:operation name="custDetails">
<wsdl:input message="tns:custDetails" name="custDetails">
</wsdl:input>
<wsdl:output message="tns:custDetailsResponse" name="custDetailsResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CustomerSvcServiceSoapBinding" type="tns:CustomerSvc">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="custDetails">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="custDetails">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="custDetailsResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CustomerSvcService">
<wsdl:port binding="tns:CustomerSvcServiceSoapBinding" name="CustomerSvcPort">
<soap:address location="http://localhost:12000/services/customerProvide"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
EDIT due to updated question
You try to unmarshal the request payload with Jax-B based on the XML schema you posted at the top of your question.
But in this schema the element custDetails does not exist. It exists in the schema part of your WSDL, but not in the schema?!? Therefore the error unexpected element.
I've created a webservice in Visual studio with WCF and when looking at the generated WSDL it includes a reference to http://schemas.microsoft.com/2003/10/Serialization which contains a lot of type specifications. I do not use any of these specifications. Does anyone know why WCF adds this and if there's any way to get rid of it?
The xml added to my wsdl looks like this when using the singleWsdl argument on my service:
<xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="anyType" nillable="true" type="xs:anyType" />
<xs:element name="anyURI" nillable="true" type="xs:anyURI" />
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary" />
<xs:element name="boolean" nillable="true" type="xs:boolean" />
<xs:element name="byte" nillable="true" type="xs:byte" />
<xs:element name="dateTime" nillable="true" type="xs:dateTime" />
<xs:element name="decimal" nillable="true" type="xs:decimal" />
<xs:element name="double" nillable="true" type="xs:double" />
<xs:element name="float" nillable="true" type="xs:float" />
<xs:element name="int" nillable="true" type="xs:int" />
<xs:element name="long" nillable="true" type="xs:long" />
<xs:element name="QName" nillable="true" type="xs:QName" />
<xs:element name="short" nillable="true" type="xs:short" />
<xs:element name="string" nillable="true" type="xs:string" />
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte" />
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" />
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong" />
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort" />
<xs:element name="char" nillable="true" type="tns:char" />
<xs:simpleType name="char">
<xs:restriction base="xs:int" />
</xs:simpleType>
<xs:element name="duration" nillable="true" type="tns:duration" />
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" />
<xs:minInclusive value="-P10675199DT2H48M5.4775808S" />
<xs:maxInclusive value="P10675199DT2H48M5.4775807S" />
</xs:restriction>
</xs:simpleType>
<xs:element name="guid" nillable="true" type="tns:guid" />
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}" />
</xs:restriction>
</xs:simpleType>
<xs:attribute name="FactoryType" type="xs:QName" />
<xs:attribute name="Id" type="xs:ID" />
<xs:attribute name="Ref" type="xs:IDREF" />
</xs:schema>
Maybe it's too late now, but I ran into this issue and was able to solve it. The reason I wanted to remove it was because I was generating clients in both Java and RPG, and the wsdl2java and wsdl2rpg tools generate large, ugly data structures based on that schema.
In my case, it was because I was using the DataContract serializer, and some of the objects I was serializing had members of types that didn't have the [DataContract] attribute. To make that extra schema go away, everything being serialized, all the way down the type tree needed to have that attribute.
It also had this problem whenever a there was an inherited public member on the service contracts.
I agree there is no need to remove it. Also many times it is used and you do not know about it. The way to change default wsdl generatio is by implementing IWsdlExportExtension:
http://msdn.microsoft.com/en-us/library/system.servicemodel.description.iwsdlexportextension.aspx
The XSD definition for microsoft's WSDL implementation imports this namespace (see here).
Why do you want to remove it?
I have a WSDL that is automatically generated by a .NET WCF service. I am trying to generate a Perl client from the WSDL using wsdl2perl.pl. It gets through several of the interfaces and objects before it chokes on
C:\strawberry\perl\site\lib\SOAP\WSDL\Generator\Template\XSD\complexType.tt undef error - unbound http found for http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Logging. Bound prefixes are wsa, soapenc, soap, wsaw, wsap, q2, xsd, wsx, xml, wsa10, q3, xs, wsam, ser, wsdl, tns, msc, q at C:/strawberry/perl/site/lib/SOAP/WSDL/Base.pm line 62
What does this mean? I can't find any documentation on the error. Since the WSDL is auto-generated by .NET, I'm not sure if I can change it. What do I need to do to resolve this error?
The WSDL I point wsdl2perl.pl to is:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" 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:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="LogService" targetNamespace="http://tempuri.org/">
<wsp:Policy wsu:Id="WSHttpBinding_ILogService_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsaw:UsingAddressing/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/FH.Logging"/>
<xsd:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd3" namespace="http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Logging"/>
<xsd:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd4" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xsd:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd5" namespace="http://schemas.datacontract.org/2004/07/System.Text"/>
<xsd:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd6" namespace="http://schemas.datacontract.org/2004/07/System.Diagnostics"/>
<xsd:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd7" namespace="http://schemas.datacontract.org/2004/07/FH.Logging.Models"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ILogService_WriteLog_InputMessage">
<wsdl:part name="parameters" element="tns:WriteLog"/>
</wsdl:message>
<wsdl:message name="ILogService_WriteLog_OutputMessage">
<wsdl:part name="parameters" element="tns:WriteLogResponse"/>
</wsdl:message>
<wsdl:message name="ILogService_RegisterApplication_InputMessage">
<wsdl:part name="parameters" element="tns:RegisterApplication"/>
</wsdl:message>
<wsdl:message name="ILogService_RegisterApplication_OutputMessage">
<wsdl:part name="parameters" element="tns:RegisterApplicationResponse"/>
</wsdl:message>
<wsdl:portType name="ILogService">
<wsdl:operation name="WriteLog">
<wsdl:input wsaw:Action="http://tempuri.org/ILogService/WriteLog" message="tns:ILogService_WriteLog_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/ILogService/WriteLogResponse" message="tns:ILogService_WriteLog_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="RegisterApplication">
<wsdl:input wsaw:Action="http://tempuri.org/ILogService/RegisterApplication" message="tns:ILogService_RegisterApplication_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/ILogService/RegisterApplicationResponse" message="tns:ILogService_RegisterApplication_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WSHttpBinding_ILogService" type="tns:ILogService">
<wsp:PolicyReference URI="#WSHttpBinding_ILogService_policy"/>
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="WriteLog">
<soap12:operation soapAction="http://tempuri.org/ILogService/WriteLog" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RegisterApplication">
<soap12:operation soapAction="http://tempuri.org/ILogService/RegisterApplication" 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="LogService">
<wsdl:port name="WSHttpBinding_ILogService" binding="tns:WSHttpBinding_ILogService">
<soap12:address location="http://www.example.com/services/LoggingService.svc"/>
<wsa10:EndpointReference>
<wsa10:Address>
http://www.example.com/services/LoggingService.svc
</wsa10:Address>
<Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
<Dns>localhost</Dns>
</Identity>
</wsa10:EndpointReference>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
And that seems to reference this for http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Logging:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Logging" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Logging" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xs:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd4" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xs:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd5" namespace="http://schemas.datacontract.org/2004/07/System.Text"/>
<xs:import schemaLocation="http://www.example.com/services/LoggingService.svc?xsd=xsd6" namespace="http://schemas.datacontract.org/2004/07/System.Diagnostics"/>
<xs:complexType name="LogEntry">
<xs:sequence>
<xs:element name="activityId" type="ser:guid"/>
<xs:element name="activityIdInitialized" type="xs:boolean"/>
<xs:element name="appDomainName" nillable="true" type="xs:string"/>
<xs:element name="appDomainNameInitialized" type="xs:boolean"/>
<xs:element name="categoryStrings" nillable="true" type="q1:ArrayOfstring" xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xs:element name="errorMessages" nillable="true" type="q2:StringBuilder" xmlns:q2="http://schemas.datacontract.org/2004/07/System.Text"/>
<xs:element name="eventId" type="xs:int"/>
<xs:element name="extendedProperties" nillable="true" type="q3:ArrayOfKeyValueOfstringanyType" xmlns:q3="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xs:element name="machineName" nillable="true" type="xs:string"/>
<xs:element name="machineNameInitialized" type="xs:boolean"/>
<xs:element name="message" nillable="true" type="xs:string"/>
<xs:element name="priority" type="xs:int"/>
<xs:element name="processId" nillable="true" type="xs:string"/>
<xs:element name="processIdInitialized" type="xs:boolean"/>
<xs:element name="processName" nillable="true" type="xs:string"/>
<xs:element name="processNameInitialized" type="xs:boolean"/>
<xs:element name="relatedActivityId" nillable="true" type="ser:guid"/>
<xs:element name="severity" type="q4:TraceEventType" xmlns:q4="http://schemas.datacontract.org/2004/07/System.Diagnostics"/>
<xs:element name="threadName" nillable="true" type="xs:string"/>
<xs:element name="threadNameInitialized" type="xs:boolean"/>
<xs:element name="timeStamp" type="xs:dateTime"/>
<xs:element name="timeStampInitialized" type="xs:boolean"/>
<xs:element name="title" nillable="true" type="xs:string"/>
<xs:element name="unmanagedCodePermissionAvailable" type="xs:boolean"/>
<xs:element name="unmanagedCodePermissionAvailableInitialized" type="xs:boolean"/>
<xs:element name="win32ThreadId" nillable="true" type="xs:string"/>
<xs:element name="win32ThreadIdInitialized" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:element name="LogEntry" nillable="true" type="tns:LogEntry"/>
</xs:schema>