I am trying to consume a WCF web service (which I did not write myself) using soap on an iPhone. I can test the service using SoapUI and .Net WebService Studio just fine when running the tools on the same web server. But when I try it from an other machine, both tools fail when attempting to import from localhost:
<wsdl:import namespace="http://MyDomain.IGeneralInterface" location="http://localhost:8000/?wsdl=wsdl0"/>
wsdl0:
<xsd:schema targetNamespace="http://MyDomain.IGeneralInterface/Imports">
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd0" namespace="http://MyDomain.IGeneralInterface"/>
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/MyDomain.IGeneralInterface"/>
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd3" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xsd:import schemaLocation="http://localhost:8000/?xsd=xsd4" namespace="http://schemas.microsoft.com/Message"/>
</xsd:schema>
I was hoping to be able to use wsdl2objc, but it cannot recognise the import either.
Can anyone please tell me why this is a problem and how to handle it???
The reason on why they fail is that your wsdl is not flat. For your WCF service to be interoperable you might consider flattening your wsdl. Please follow the link below:
How to flatten your wsdl.
NOTE : if you are .NET 4.5 then you would have this as an inbuilt feature. i.e. when you develop your service you would see an url that generates flat wsdl.
Related
I have an OData URI generated by a consumer desktop application like so
http://localhost:32702/TBC/Projects/15f1360adb2e4008921b9b5bb849ae78/
Entering this into my browser I can view the atom XML and see collections that should be available
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<service xmlns="http://www.w3.org/2007/app" xmlns:app="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xml:base="http://localhost:32702/TBC/Projects/15f1360adb2e4008921b9b5bb849ae78/">
<workspace>
<atom:title>Default</atom:title>
<collection href="FeatureAttributes">
<atom:title>FeatureAttributes</atom:title>
</collection> -<collection href="Points">
<atom:title>Points</atom:title>
</collection> -<collection href="TotalStations">
<atom:title>TotalStations</atom:title>
</collection> -<collection href="Vectors">
<atom:title>Vectors</atom:title>
</collection>
</workspace>
</service>
So I then change my browser URI to include the Points collection or the Vectors collection
http://localhost:32702/TBC/Projects/15f1360adb2e4008921b9b5bb849ae78/Points
And it only returns the current date for each item I was expecting, no actual data. The count of items, however is accurate. I was hoping to be able to use this in a LinqPad or VB.Net query application, but I can't even get the browser queries to work. Is it me or is there an issue with the service? I've tried the URI in LinqPAD and in a test project with WCF Data Services and when I test the same URI I get a (500) Internal Server Error.
The vendor is not providing any support, so I was hoping someone here could give me some troubleshooting steps to show where the issue is at.
Edit:
I modified IE options > Content > Feed Settings by unchecking "Turn on feed reading view"
This allowed me to see the data from the returned entity collection. I can now try to use WebRequest to consume the XML data in a .net application.
Adding $metadata to the URI in the browser yields "Website cannot display the page". Which leads me to guess that only feeds are exposed and no services. I'm not sure if this is possible.
I'm still unable to use this URI in LinqPad or in visual studio using Add Service Reference. VS returns error "An error occurred while attempting to find service at URI.
I'm not sure about LinqPad, but "Add service reference" in Visual Studio expects a link to your $metadata endpoint or the service document (i.e., the first query in your question). You can access the Points collection using both of those tools as a secondary step.
I'm not sure why your $metadata endpoint is not showing up though. If you right-click and "view source", do you see the xml document there?
How can I change WSDL2.0 of a service that will be deployed on WSO2 Application Server?
I want to change WSDL content of a service that developed and will be deployed on WSO2 Application Server. I moved custom WSDL file to META-INF directory and set useOriginalwsdl=true property. but only WSDL version 1.1 is that affected by this property. I want to use the custom WSDL 2.0 for my service in WSO2 Application Server. How can I do it?
WSO2 Application Server uses Axis2 1.6.x and useOriginalwsdl=true is in fact not supported for WSDL 2.0. See following JIRA.
https://issues.apache.org/jira/browse/AXIS2-5191
According to the JIRA, it is fixed in Axis2 1.7.0, which is not yet released.
If you really want to use that feature, it might be easier to patch the existing version of Axis2. The fix attached to the JIRA is simple, but I'm not really sure how much code changes are required. The patch is provided for axis2 trunk and therefore I cannot really tell without trying first!
Also the code for Axis2 versions used in WSO2 products are in WSO2 repository. For example, WSO2 Application Server 5.1.0 uses axis2 1.6.1-wso2v9 according to Carbon Release Matrix.
I hope this helps!
I'm using schema-first web service development approach by hand-coding WSDL/XSD and then feeding it to svcutil tool to generate .NET data and service contracts. I've tried to introduce WS-Addressing into my WSDL by including "UsingAddressing" element both directly into binding and as WS-Policy import. Policy import is ignored, but I get the following error, when "UsingAddress" is included directly into WSDL binding: "WSDL extension element "UsingAddressing" from namespace 'http://www.w3.org/2006/05/addressing/wsdl' was not handled".
According to MSDN, "UsingAddressing" element is supported by WCF (http://msdn.microsoft.com/en-us/library/ms996497.aspx), so is it so, that this element is not supported by svcutil?
For anyone coming across this, I had the same problem trying to generate a proxy with svcutil. I had to generate the proxy via VS2017 and it worked.
I want to consume a web service of which I have the wsdl. I am using spring-ws and want to use marshalling/unmarshalling (jaxb) to convert xml to java and vice versa. How can I get the jaxb classes from the wsdl. Do I need access to xsd which in this case I don't have. Can I use a tool like trang to do the work?
look here http://blog.dawouds.com/2008/09/maven-2-wsdl-to-java-using-jaxb.html
You can use the tool Apache CXF to create a Web-service client in Java from the WSDL. Follow the official page: http://cxf.apache.org/docs/developing-a-consumer.html
My problem is closely related to this one: How can I use .NET web services from non-standard ports?. My web service runs behind a port-forwarding firewall, so the port numbers reported in the WSDL document contain the internal high-numbered port. I wrote a SoapExtensionReflector class which is able to rewrite the WSDL document. So a request like example.com/path/loginservice?wsdl is handled correctly.
However, this doesn't handle the "disco" request: example.com/path/loginservice?disco. This returns an XML document like this:
<discovery>
<contractRef ref="http://example.com:10092/loginservice.asmx?wsdl" docRef="http://example.com:10092/loginservice.asmx"/>
<soap address="http://example.com/path/loginservice.asmx" binding="q1:LoginServiceSoap"/>
<soap address="http://example.com/path/loginservice.asmx" binding="q2:LoginServiceSoap12"/>
</discovery>
While the soap bindings have been properly re-written by the SoapExtensionReflector, the contractRef and docRef URLs have the high-numbered port. How can I rewrite them as well?
Finally figured something out. Created proxy classes manually using svcutil after migrating everything to WCF. I figure you could probably do the same thing using the wsdl tool that came with the old asp.net web services, but I haven't tried that.