type definition not found with jaxb - jaxb

I'm able to generate java classes running mvn clean install with jaxb on https://github.com/carlossg/docker-maven/blob/da92f8b0c8530061c539dcfc5c0257ce8565568b/jdk-8-alpine/Dockerfile, but if i try to generate on my local machine ubuntu 14, same java and maven version i'm getting the following error. Any suggestion on how to fix it?
Thanks,
Jorge
enterCommonReqRsp.xsd file
<xs:include schemaLocation="Common.xsd"/>
<!--*** Request Types ***-->
<xs:complexType name="BaseReq">
<xs:complexContent>
<xs:extension base="BaseCoreReq">
<xs:sequence>
<xs:element ref="OverridePCC" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="RetrieveProviderReservationDetails" type="xs:boolean" use="optional" default="false"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
SharedBookingReqRsp.xsd file
<xs:import namespace="http://www.travelport.com/schema/common_v42_0" schemaLocation="../common_v42_0/CommonReqRsp.xsd"/>
<xs:complexType name="BookingBaseReq">
<xs:annotation>
<xs:documentation>Context for Requests</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="common:BaseReq"/>
</xs:complexContent>
</xs:complexType>
SharedBookingReqRsp.xsd; lineNumber: 15; columnNumber: 46; src-resolve: Cannot resolve the name 'common:BaseReq' to a(n) 'type definition' component.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4156)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:4139)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getGlobalDecl(XSDHandler.java:1745)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexContent(XSDComplexTypeTraverser.java:768)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexTypeDecl(XSDComplexTypeTraverser.java:315)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseGlobal(XSDComplexTypeTraverser.java:191)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseSchemas(XSDHandler.java:1434)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:633)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:613)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:572)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:538)
at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:255)
at com.sun.tools.xjc.reader.xmlschema.parser.SchemaConstraintChecker.check(SchemaConstraintChecker.java:111)
at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:360)
at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:174)
at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:119)
at org.jvnet.mjiip.v_2_2.XJC22Mojo.loadModel(XJC22Mojo.java:50)
at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:40)
at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:28)
at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:473)
at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:316)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:186)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Related

jaxb2-maven-plugin:2.2:xjc - Undeclared Prefix Issue - java 1.7

I am using the below dependencies in my pom.xml
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.1.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.3.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
binding.xjb :
<jxb:bindings version="1.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="../../../../xsd/icmarchitecture/mom/log/RetrieveExecutionInfo.xsd" node="/xs:schema">
<jxb:globalBindings>
<jxb:javaType name="com.pcm.icm.architecture.util.Timestamp" xmlType="icm:Timestamp" printMethod="toXsdString" parseMethod="create"/>
</jxb:globalBindings>
RetrieveExecutionInfo.xsd :
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by pcm (pcm) -->
<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by bbl (bbl) -->
<xs:schema
targetNamespace="http://www.pcm.com/icm/architecture/mom/log/payload"
xmlns="http://www.pcm.com/icm/architecture/mom/log/payload"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://www.pcm.com/icm/architecture/status/payload"
xmlns:icm="http://www.pcm.com/icm/architecture/common/payload"
elementFormDefault="qualified" attributeFormDefault="qualified">
<xs:import
namespace="http://www.pcm.com/icm/architecture/status/payload"
schemaLocation="../../status/status.xsd"/>
<xs:import
namespace="http://www.pcm.com/icm/architecture/common/payload"
schemaLocation="../../common/ICMTypedefinitions.xsd"/>
<xs:complexType name="FilterKeyValueType">
<xs:annotation>
<xs:documentation>Filter on key value pair</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Key" type="xs:string"/>
<xs:element ref="Operator"/>
<xs:element name="Value" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="FilterKey">
<xs:annotation>
<xs:documentation>Filter on Key</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="Operator"/>
<xs:element name="Value" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="KeyValueType">
<xs:annotation>
<xs:documentation>Key value pair</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Key" type="xs:string"/>
<xs:element name="Value" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Operator">
<xs:annotation>
<xs:documentation>Operator for a filter</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="greater_equal"/>
<xs:enumeration value="greater"/>
<xs:enumeration value="less"/>
<xs:enumeration value="less_equal"/>
<xs:enumeration value="not_equal"/>
<xs:enumeration value="equal"/>
<xs:enumeration value="like"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="FilterService">
<xs:annotation>
<xs:documentation>Filter on service</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="ServiceAddress"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FilterTimestamp">
<xs:annotation>
<xs:documentation>Filter on timestamp</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="Operator"/>
<xs:element name="Value" type="icm:Timestamp"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ExecutionInfoElement">
<xs:annotation>
<xs:documentation>Reply element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="ServiceAddress"/>
<xs:element name="RequestTimestamp" type="icm:Timestamp" minOccurs="0"/>
<xs:element name="DurationInMillis" type="xs:long" minOccurs="0"/>
<xs:element name="RequestLogMsgId" type="xs:string" minOccurs="0"/>
<xs:element name="KeyValue" type="KeyValueType" minOccurs="0" maxOccurs="999"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FilterMillis">
<xs:annotation>
<xs:documentation>Filter on millis</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="Operator"/>
<xs:element name="Value" type="xs:long"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ServiceAddress">
<xs:annotation>
<xs:documentation>Service address</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="service" type="xs:string" minOccurs="0"/>
<xs:element name="protocol" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="RetrieveExecutionInfoRq">
<xs:annotation>
<xs:documentation>Request to get execution info elements</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="FilterService" minOccurs="0" maxOccurs="999"/>
<xs:element ref="FilterTimestamp" minOccurs="0" maxOccurs="999"/>
<xs:element ref="FilterMillis" minOccurs="0" maxOccurs="999"/>
<xs:element name="AndFilterKeyValue" type="FilterKeyValueType" minOccurs="0" maxOccurs="999"/>
<xs:element name="OrFilterKeyValue" type="FilterKeyValueType" minOccurs="0" maxOccurs="999"/>
<xs:element ref="FilterKey" minOccurs="0" maxOccurs="999"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RetrieveExecutionInfoRs">
<xs:annotation>
<xs:documentation>Reply with execution info elements</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="statusInfo" type="ns1:statusType"/>
<xs:element ref="ExecutionInfoElement" minOccurs="0" maxOccurs="999"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Maven version - 3.1
Java Version - 1.7
Error :
org.xml.sax.SAXParseException; systemId: file:/C:/Data/NewGitRepo/TestICMGitRepo/ICMTrunk/icmarchitecture/src/main/resources/xjb/icmarchitecture/mom/log/binding.xjb; lineNumber: 7; columnNumber: 136; UndeclaredPrefix: Cannot resolve 'icm:Timestamp' as a QName: the prefix 'icm' is not declared.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
org.xml.sax.SAXParseException; systemId: file:/binding.xjb; lineNumber: 7; columnNumber: 136; cvc-attribute.3: The value 'icm:Timestamp' of attribute 'xmlType' on element 'jxb:javaType' is not valid with respect to its type, 'QName'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
I am getting the above exception when do maven clean install through eclipse with java 1.7 compiler
But If i change the java compiler to 1.8 its working fine. but i want to deploy this jar in JBoss server which is having the java 1.7 version.
Please help on this. Thanks in Advance.
You should declare your icm prefix in the bindings file.
Add xmlns:icm="<URI of the icm namespace here>" to the root element.
This has less to do with JAXB and more with XML. JAXB expects a "qualified name" as #xmlType. "Qualified name" means the prefix must be defined and point to the correct namespace.

specifying a JAXB external binding for XSD sequence nodeName and choice/sequence nodeName

I'm trying to eliminate "Element "___" shows up in more than one properties" with jxb external bindings on a xsd I don't maintain.
I can modify the XSD with the following that works:
<xs:complexType name="credit">
<xs:sequence>
<xs:element .../>
<xs:element name="link" type="link" minOccurs="0" maxOccurs="unbounded">
<xs:annotation> <xs:appinfo> <jxb:property name="linkElement"/> </xs:appinfo> </xs:annotation>
</xs:element>
<xs:choice>
<xs:sequence>
...
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="link" type="link" minOccurs="0" maxOccurs="unbounded"/>
...
</xs:sequence>
</xs:sequence>
</xs:choice>
</xs:sequence>
...
to create the sequence linkElement of type Link and sequence of choices:
#XmlElement(name = "link")
protected List<Link> linkElement;
...
#XmlElements({
#XmlElement(name = "link", type = Link.class),
...
})
protected List<Object> linkAndBookmarkAndCreditWords;
but when I try a JAXB external binding file with the likes of:
<jxb:bindings node="//xs:complexType[#name='credit']//xs:sequence//xs:element[#name='link']" >
<jxb:property name="linkElement" />
</jxb:bindings>
I get the error:
[ERROR] XPath evaluation of "...[#name='link']" results in too many (2) target nodes
How can I distinguish only the first "link" node as I do in the internal bindings?
You XPath-expression is not precise enough. These // mean "anywhere below current node". This includes both of your link elements.
Try making your XPath-expression more precise, something along the lines:
xs:complexType[#name='credit']/xs:sequence/xs:element[#name='link']

XSD - Make an attribute required only depending of the parent tag

In my xml shema I can put the tag <item> inside 2 different parent like this :
<page>
<item name="foo"/>
</page>
or
<page>
<list>
<item class="path/to/class"/>
</list>
</page>
How can I say in my xsd, name attribute is mandatory only when the direct parent is <page> ?
I found the answer :
<xs:complexType name="listItemType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="class" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="itemType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="name" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="listType">
<xs:sequence>
<xs:element type="listItemType" name="item" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="pageType">
<xs:sequence>
<xs:element type="itemType" name="item" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>

CICS web services - XML parse error

I am currently working in CICS web services and new to XML/WSDL concepts. I got a WSDL file from middleware team and tried to execute the DFHWS2LS utility to create a COBOL language structure from that WSDL. I am getting the following error and was not able to fix this. And suggestions?
DFHPI9027E The XML parser has found an error: "XSD: The attribute
'minOccurs' is not permitted" at line "1" and column"19,015" in
document "file:/AIGNDVR/DEVL1/ELC/WSDL/MakeOkToSellServiceSOAP.wsdl".
DFHPI9558E ERRORS have been generated processing file
"/AIGNDVR/DEVL1/ELC/WSDL/ MakeOkToSellServiceSOAP.wsdl".
XML:
<?xml version="1.0" encoding="EBCDIC-CP-US"?>
<wsdl:definitions name="MakeOkToSell" targetNamespace="http://MakeOkToSell/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://MakeOkToSell/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl/" >
<wsdl:types>
<xs:schema targetNamespace="http://MakeOkToSell/">
<xs:element name="MakeOkToSellRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="RequestSystemName" type="xs:string"/>
<xs:element name="RequestSystemGearID" type="xs:int"/>
<xs:element name="transactionIdentifier" type="xs:string" minOccurs="0"/>
<xs:element name="OkToSellDetails">
<xs:complexType>
<xs:sequence>
<xs:element name="CompanyCode" type="xs:string" minOccurs="0"/>
<xs:element name="PolicyNumber" type="xs:string" minOccurs="0"/>
<xs:element name="UplineID" type="xs:string" minOccurs="0"/>
<xs:element name="SSN" type="xs:int" minOccurs="0"/>
<xs:element name="NPN" type="xs:string" minOccurs="0"/>
<xs:element name="AgencyCode" type="xs:string" minOccurs="0"/>
<xs:element name="First5digitSSNandLastName" type="xs:string" minOccurs="0"/>
<xs:element name="RequestType" type="xs:string" minOccurs="0"/>
<xs:element name="AgentPositionID" type="xs:string" minOccurs="0"/>
<xs:element name="PrimaryAgentID" type="xs:string" minOccurs="0"/>
<xs:element name="AgentFirstName" type="xs:string" minOccurs="0"/>
<xs:element name="AgentLastName" type="xs:string" minOccurs="0"/>
<xs:element name="ApplicationState" type="xs:string"/>
<xs:element name="ProductID" type="xs:string"/>
<xs:element name="ProductType" type="xs:string" minOccurs="0"/>
<xs:element name="ApplicationReceivedDate" type="xs:date"/>
<xs:element name="ApplicationSignedDate" type="xs:date"/>
<xs:element name="GrossPremium" type="xs:decimal" minOccurs="0"/>
<xs:element name="NetPremium" type="xs:decimal" minOccurs="0"/>
<xs:element name="AdditionalData" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Property" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" minOccurs="1">
<xs:attribute type="xs:string" name="name"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MakeOkToSellResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="UID">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="EvaluationStatus">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="TaskID" type="xs:string" minOccurs="0"/>
<xs:element name="ErrorDetails" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ErrorCode" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ErrorType" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ErrorMessage" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ObjectType" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ObjectID" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Warnings" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="WarningCode" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="WarningType" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="WarningMessage" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ObjectType" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ObjectID" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MakeOkToSellFault">
<xs:complexType>
<xs:all>
<xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
<xs:element name="errorCode" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="MakeOkToSellRequest">
<wsdl:part element="impl:MakeOkToSellRequest" name="parameters"/>
</wsdl:message>
<wsdl:message name="MakeOkToSellResponse">
<wsdl:part element="impl:MakeOkToSellResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="MakeOkToSellFault">
<wsdl:part element="impl:MakeOkToSellFault" name="parameters"/>
</wsdl:message>
<wsdl:portType name="MakeOkToSellService">
<wsdl:operation name="MakeOkToSell">
<wsdl:input message="impl:MakeOkToSellRequest" name="MakeOkToSellRequest"/>
<wsdl:output message="impl:MakeOkToSellResponse" name="MakeOkToSellResponse"/>
<wsdl:fault message="impl:MakeOkToSellFault" name="MakeOkToSellFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MakeOkToSellServiceBinding" type="impl:MakeOkToSellService">
<wsaw:UsingAddressing wsdl:required="false"/>
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="MakeOkToSell">
<wsdlsoap:operation soapAction="urn:MakeOkToSell"/>
<wsdl:input name="MakeOkToSellRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="MakeOkToSellResponse">
<wsdlsoap:body use="literal"/>enter code here
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MakeOkToSellService">
<wsdl:documentation>WSDL File for MakeOkToSell</wsdl:documentation>
<wsdl:port binding="impl:MakeOkToSellServiceBinding" name="MakeOkToSellServiceSOAP">
<wsdlsoap:address location="http://localhost:9080/MakeOkToSellService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
DFHWS2Ls is presumably being run from JCL on the MF. I note that the WSDL document has an encoding of EBCDIC-CP-US, which makes sense, but that's not the encoding we're viewing it in. I presume that the WSDL has either been pretty-printed here for legibility, or a transcoding error caused everything to flow into one long line in the EBCDIC version.
I've loaded the WSDL up in a WSDL validator (I used the validator in the Eclipse Web Tools project). It reported the same problem, only this time at line 39: <xs:extension base="xs:string" minOccurs="1"> . I'm not sure what the WSDL author was trying to achieve, but that minOccurs is invalid in XML, I'd suggest deleting it.
[edited to correct markup on XML tags]

MissingPropertyException: No such property: Error in Groovy script

I execute the following Groovy script in my SoapUI
import com.*
import javax.xml.XMLConstants
import javax.xml.transform.stream.StreamSource
import javax.xml.validation.SchemaFactory
def xsd = '''
<xs:schema targetNamespace="http://maps.googleapis.com" elementFormDefault="qualified" xmlns="http://maps.googleapis.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="GeocodeResponse" type="_GeocodeResponse"/>
<xs:complexType name="result_geometry">
<xs:sequence>
<xs:element name="location" type="geometry_location"/>
<xs:element name="location_type" type="xs:string"/>
<xs:element name="viewport" type="geometry_viewport"/>
<xs:element name="bounds" type="geometry_bounds"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="viewport_southwest">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="bounds_northeast">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="geometry_viewport">
<xs:sequence>
<xs:element name="southwest" type="viewport_southwest"/>
<xs:element name="northeast" type="viewport_northeast"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="geometry_bounds">
<xs:sequence>
<xs:element name="southwest" type="bounds_southwest"/>
<xs:element name="northeast" type="bounds_northeast"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="bounds_southwest">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="viewport_northeast">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="_GeocodeResponse">
<xs:sequence>
<xs:element name="status" type="xs:string"/>
<xs:element name="result" type="GeocodeResponse_result"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="address_component">
<xs:sequence>
<xs:element name="long_name" type="xs:string"/>
<xs:element name="short_name" type="xs:string"/>
<xs:element name="type" type="xs:string" maxOccurs="2"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="GeocodeResponse_result">
<xs:sequence>
<xs:element name="type" type="xs:string" maxOccurs="2"/>
<xs:element name="formatted_address" type="xs:string"/>
<xs:element name="address_component" type="address_component" maxOccurs="3"/>
<xs:element name="geometry" type="result_geometry"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="geometry_location">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
'''.trim()
def factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
def schema = factory.newSchema(new StreamSource(new StringReader(xsd)))
def validator = schema.newValidator()
validator.validate(new StreamSource(new StringReader(XmlExamples.G_RECORDS)))
XmlExamples.groovy is located in C:\Program Files\SmartBear\SoapUI-4.6.1\bin\ext\com
i.e.
class XmlExamples {
static def G_RECORDS = '''
<GeocodeResponse>
<status>OK</status>
.....
</bounds>
</geometry>
</result>
</GeocodeResponse>
'''
}
But problem is I am getting following error in SoapUI
:ERROR:groovy.lang.MissingPropertyException: No such property: XmlExamples for class: Script1
groovy.lang.MissingPropertyException: No such property: XmlExamples for class: Script1
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at Script1.run(Script1.groovy:86)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:149)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
What could be the possible root causes. Is there anything to do with CLASSPATH? I believe the default location would be .......bin/ext
Cheers
The class XmlExamples seems to be missing the correct package declaration. Since it resides in a package called com you should have the following class:
package com
class XmlExamples {
static def G_RECORDS = '''
<GeocodeResponse>
<status>OK</status>
.....
</bounds>
</geometry>
</result>
</GeocodeResponse>
'''
}
It appears that you are trying to validate an xml with the xsd using the example and the same sample code is successfully got executed in SoapUI tool when I tried both code snippets copied in same groovy script. May be you would want to try like that to isolate the problem.

Resources