I have been working with an Apex class in SalesForce that has been working perfectly in terms of updating, generating the new WSDL and updating the reference in Visual Studio. Yesterday I added a new method and now I get an invalid schema error in VS when trying to update the reference. I tested the validaty of the WSDL here www.wsdl-analyzer.com and sure enough it gave me the error:
The reference ns1:ID in the XML Schema references a type or element that is not defined. Please make sure that your Schema documents are correct.
Looking at the xml file I can see that even in visual studio it doesnt like this particular line or several of the others as well:
<xsd:element name="CreatedById" minOccurs="0" type="ns1:ID" nillable="true"/>
The first few lines of the xml file look like (I've replaced parts with xxxx for privacy but they refer to the SF instance):
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="http://soap.sforce.com/schemas/class/xxxx" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://soap.sforce.com/schemas/class/xxxx" xmlns:AvailabilityExtended="http://soap.sforce.com/schemas/class/AvailabilityExtended" xmlns:BookingWrapper="http://soap.sforce.com/schemas/class/BookingWrapper">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/AvailabilityExtended">
Any suggestions?
Related
My goal is to add #Entity annotations to the classes that are generated from a wsdl. I'm using cxf-codegen-plugin's wsdl2java goal, and pointing at a local wsdl file. I can generate all the sources without any problem, but when I try to add a binding file, I'm running into problems.
Here's a segment of the wsdl (the file is CAAudit.wsdl and is in my resources directory):
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions targetNamespace="http://www.ocse.gov/quick/wsdl/CAAudit.wsdl"
xmlns:audw="http://www.ocse.gov/quick/wsdl/CAAudit.wsdl"
xmlns:audx="http://www.ocse.gov/quick/wsdl/CAAudit.xsd"
xmlns:qikrsp="urn:us:gov:hhs:acf:qikrsp"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
name="CAAudit"
>
<wsdl:types>
<xsd:schema targetNamespace="http://www.ocse.gov/quick/wsdl/CAAudit.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<xsd:import namespace="urn:us:gov:hhs:acf:qikrsp"
schemaLocation="QuickResponse.xsd" />
<xsd:complexType name="NotifyCAAuditRequest" >
<xsd:sequence>
<xsd:element ref="qikrsp:QuickResponse" />
</xsd:sequence>
</xsd:complexType>
....
My first question is I'm really not certain what should go in the binding file. First, I'm pretty sure that I need jaxws bindings to work with the wsdl (the jaxb binding only has the schemaLocation attribute), although I don't need to generate web service classes.
Next, I'm not sure I'm not sure if the introduction of a new xmlns in the schema element will cause problems for an xpath search. I did have problems running it with notepad++'s xpath evaluation.
Also, I'm not sure if the fact that the QuickResponse element (which is the class I want to annotate) is defined by a reference is hindering my efforts. I'm not sure if or how (or where) I would include the referenced xsd file.
Here is one possible binding file (I was just trying to get an #Generated on the class to start with):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:annox="http://annox.dev.java.net"
jaxb:extensionBindingPrefixes="annox"
jaxb:version="2.1"
>
<jaxws:bindings wsdlLocation="CAAudit.wsdl"
node="/wsdl:definitions/wsdl:types">
<jaxb:bindings node=".//xsd:schema">
<annox:annotate>#javax.annotation.Generated({"JAXWS"})</annox:annotate>
</jaxb:bindings>
</jaxws:bindings>
</jaxb:bindings>
I did not manage to customize schema embedded in WSDL. This are my latest efforts:
https://github.com/highsource/jaxb2-annotate-plugin/blob/master/tests/jaxws/src/main/resources/wsdl-bindings.xjb
What works with WSDLs is attaching customizations via SCD. But SCD does not allow proprietary customization elements (like annotate:*). So that won't help with jaxb2-annotate-plugin.
So the only thing which would probably work is to extract schema from the WSDL into an own file.
I am trying to create an invoice in QB for windows. Here is the XML:
<?xml version='1.0' encoding='utf-8'?>
<Add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.intuit.com/sb/cdm/v2" xsi:schemaLocation="http://www.intuit.com/sb/cdm/V2./RestDataFilter.xsd " RequestId="1836474224e142c9ad9b7dd6cb0eaa41" FullResponse="true">
<OfferingId>ipp</OfferingId>
<ExternalRealmId>596059545</ExternalRealmId>
<Invoice>
<Header>
<TxnDate>2013-01-30</TxnDate>
<DiscountAmt>0</DiscountAmt>
<ARAccountName>Sales - Support and Maintenance</ARAccountName>
<DiscountAccountName>Discounts/Refunds</DiscountAccountName>
<DueDate>2013-02-17</DueDate>
<Currency>USD</Currency>
<CustomerId>4</CustomerId>
</Header>
<Line>
<Qty>1</Qty>
<UnitPrice>7.00</UnitPrice>
<Desc>Follow-up Test, Instant for Person138-Org3 Person138-Org3</Desc>
</Line>
</Invoice>
</Add>
Here's the response:
-2001: cvc-complex-type.2.4.a: Invalid content was found starting with element 'ARAccountName'. One of '{"http://www.intuit.com/sb/cdm/v2":DiscountAccountId, "http://www.intuit.com/sb/cdm/v2":DiscountAccountName, "http://www.intuit.com/sb/cdm/v2":DiscountTaxable, "http://www.intuit.com/sb/cdm/v2":TxnId}' is expected.
I don't understand, as I already have DiscountAccountName specified. I also tried to go with something more like the create example (same as above but with ARAccountName and DiscountAccountName removed) and got a similar response. Thanks in advance for your help.
The Intuit XML requests are validated by an XSD, and with XML validated by XSDs the order of the tags you provide matters.
That means that if the documentation (https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0050_Data_Services/0500_QuickBooks_Windows/0600_Object_Reference/Invoice) dictates that ARAccountName comes before DiscountAmt, then you must put ARAccountName before DiscountAmt.
Switch the order of your XML tags to match the order shown in the docs, and you'll be all set.
I am using Websphere Message Broker to create web services. I have two services and two wsdl. One of them has no issues and I am able to add WSDL through soap ui.
The other webservice's wsdl is getting displayed in IE but not able to add it in soap ui
getting
Error loading [http://localhost:7800/SearchRQ.xsd] Unexpected element: CDATA on line 1, column 1
Here is the difference in wsdl from IE of both the wsdl:
Search:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="SearchRQ.xsd" />
<xsd:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="SearchRS.xsd" />
</xsd:schema>
DescriptiveInfo:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="http://localhost:31961/DescriptiveInfo?xsd=xsd1" />
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="http://localhost:31961/DescriptiveInfo?xsd=xsd2" />
</xsd:schema>
Any idea? Please help me!!!!
I solved the issue. I placed the WSDL in exactly same structure as targetNamespace defined and used targetNamespace in xsd:schema tag similar to wsdl's targetNamespace.
I try to import some valid schema (for xmlspy and oxygen) with XMLMapper in delphi and I have this error
"Error Flux if:InfofileType unknown".
I use namespace and this type is define in another file.
Is there a way to solve this ?
(I also try with Delphi 2010 demo and it still not work)
<?xml version="1.0" encoding="UTF-8" ?>
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:if="http://www.gtest.fr/Apps/InfoFile" xmlns:ca="http://www.gtest.fr/Apps/CommandAnswer" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.gtest.fr/Apps/InfoFile" schemaLocation="InfoFile.xsd" />
<xs:import namespace="http://www.gtest.fr/Apps/CommandAnswer" schemaLocation="CommandAnswer.xsd" />
- <xs:element name="ServerAnswer">
- <xs:annotation>
<xs:documentation>Reponse serveur socket</xs:documentation>
</xs:annotation>
- <xs:complexType>
- <xs:sequence>
<xs:element name="InfoFile" type="if:InfoFileType" />
<xs:element name="Command" type="ca:CommandAnswerType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
reported in QC : http://qc.embarcadero.com/wc/qcmain.aspx?d=80124
I would still try to grab a Delphi 2010 (trial) and see if it works there.
I know there has been significant work done there in D2009 and D2010. It was notoriously bad at doing imports and includes.
Much better now...
If you cannot solve this, I would recommend to manually edit the schemas to remove the include/import and build a big fat XSD without the external file. It should work better.
That's how I did with a rather intricate set of schemas that even .Net lib would choke on.
Update: Could you try to replace the if:InfoFile by another symbol to avoid any clash with the if reserved word; i.e. search 'n' replace if in the schemas by _if_ or anything else... The XML mapper is supposed to care of this but, ya know...
Eric Thorniley finally give me the way to go here.
It seems XML Mapper does not
understand the namespaces correctly.
You can however coax it into life by
adding an extra namespace definition
into the imported files. This is, I am
sure, not right.
So, for instance, in your
Insurance.xsd you declare
xmlns:Utils="http://www.gtest.fr/Apps/Utils"
If you add exactly the same definition
into Utils.xsd, XML Mapper imports it
correctly (I think!)
Ther is a fair chance that XML Spy
would strip out my modifications -
certainly Enterprise Architect ignores
them completely.
I'd like to see the message that Eric Thorniley pointed you to, but it is no longer there. I might be able to find it in an archive somewhere, if I had the subject of the message. I tried a Google search but all I found were duplicate copies of this post on different sites.
Thanks
I have a Java web service to which I've linked from a Delphi 2007 app using the WSDL Importer. Setting it up has been a rocky road but I'm almost there!
I now have the situation where my arrays aren't being serialized in a way that my Java web service can consume. I've written the same app in .Net to test it out (it works fine) and the XML I'm looking to generate looks like this: -
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body xmlns:NS2="http://path.to.service">
<NS1:addActivities xmlns:NS1="http://path.to.service/">
<login href="#1"/>
<project xsi:type="xsd:string">PROJ001</project>
<activities>
<id xsi:type="xsd:string">DELPHITEST</id>
<name xsi:type="xsd:string">This is a test</name>
</activities>
<activities>
<id xsi:type="xsd:string">DELPHITEST2</id>
<name xsi:type="xsd:string">This is another test</name>
</activities>
</NS1:addActivities>
<NS2:login id="1" xsi:type="NS2:login">
<database xsi:type="xsd:string">My_database</database>
<password xsi:type="xsd:string">neverUmind</password>
<username xsi:type="xsd:string">bob</username>
</NS2:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
However, the XML that Delphi generates is as follows: -
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body xmlns:NS2="http://path.to.service/">
<NS1:addActivities xmlns:NS1="http://path.to.service/">
<login href="#1"/>
<project xsi:type="xsd:string">PROJ001</project>
<activities xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="NS2:activity[2]">
<item href="#2"/>
<item href="#3"/>
</activities>
</NS1:addActivities>
<NS2:login id="1" xsi:type="NS2:login">
<database xsi:type="xsd:string">My_database</database>
<password xsi:type="xsd:string">neverUmind</password>
<username xsi:type="xsd:string">bob</username>
</NS2:login>
<NS2:activity id="2" xsi:type="NS2:activity">
<id xsi:type="xsd:string">DELPHITEST</id>
<name xsi:type="xsd:string">This is a test</name>
</NS2:activity>
<NS2:activity id="3" xsi:type="NS2:activity">
<id xsi:type="xsd:string">DELPHITEST2</id>
<name xsi:type="xsd:string">This is another test</name>
</NS2:activity>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Basically, I need Delphi to stop creating activity elements within the activities element and instead just put each ID and Name inside the an activities element (as .Net does and Java seems to expect).
I've buggered about with the InvRegistry.RegisterInvokeOptions and the RemClassRegistry.RegisterSerializeOptions but none of the combinations seem to work. To be honest I'm on the verge of writting my own XML parser for this as it's taking way to long to figure out. However, if anyone has any suggestions on how this should work I'd be very grateful.
Surely somebody out there must have consumed a Java-WS web service via Delphi 2007 before :)
TIA
It seems the XMLDocument component in Delphi 2007 is broken. I've installed the Alcinoe component instead and that works a charm. That was only a week wasted ... grrrr