Tuesday, March 17, 2015

Contract Relationship issue where relationship can/ can't be swapped

Are the following two relationships considered as duplicates?

OriginalContractId     DestContractId       RelationshipType
A                                B                             C
B                                A                             C

Answer

Yes, they are duplicated. if you add the relationships as described in the question, you will get error:
<ErrorMessage>Duplicate record already exists for the following:ContractRelationship</ErrorMessage>
As it's documented in Developer's Guide and Transaction Reference Guide,
"Duplicate Check 

This validator makes sure that the ContractRelationship that is to be added is not a duplicate of an existing ContractRelationship. A ContractRelationship is considered a duplicate if the OrigContractId, DestContractId, and RelationshipType values are found to be identical."

Additionally, OriginalContractId, DestContractId, and RelationshipType are considered as a set of data, it doesn't matter if it's from or to.

Finally, EndDate is not a consideration for Duplicate Check.

Tuesday, March 3, 2015

Web Services Error where Googling didn't help much

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault xmlns:axis2ns4="http://schemas.xmlsoap.org/soap/envelope/">
         <faultcode>axis2ns4:Client</faultcode>
         <faultstring>The endpoint reference (EPR) for the Operation not found is http://localhost:9082/sampleAppWeb/managecustomerlink and the WSA Action = . If this EPR was previously reachable, please contact the server administrator.</faultstring>
         <detail/>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope> 



The above is the SOAP response that seemed mindbogglingly complex but just as simple to resolve. There's not much information in Google about it except generic answers like

Service might not be up, check the service! Port might be wrong. But I had everything right.

Hello! This is an Axis2 Web Service!


I saw this coming at my end point. So what's the issue here?

The issue is that in the XSDs there is multiple reference. Not that it's not legal, but for some reason the endpoint was unreachable.

My input XSD was having 2 references to 2 different XSDs. First one being the header, second one being another XSD with values. Such a reference was causing this issue and once I removed that reference and had my elements and attributes in the First xsd itself, the issue was gone and the request was hitting the code.

It's very important to revisit the schema and the XSDs even though the references are legal between two XSDs there might be a drawback in how the request reaches the code through the schema

Will post screenshots soon.