[arin-tech-discuss] Question about your RESTful Server, method PUT

Tim Christensen timc at arin.net
Wed Apr 13 11:54:14 EDT 2011


Hello Sean,

After reviewing both your submission here, and looking at a few things internally, we have identified that there are (at the least) some documentation gaps, if not an outright bug.

A “best practice” that is consistent with the Methods and Payloads documentation, but may not be expressed in an explicit or obvious enough manner, is that you should omit system-generated attributes from payloads that create new objects.  Furthermore, it’s a very good idea that if you are omitting optional fields, that you (also) not provide “empty” tags.

For a reallocate, the only things you should need to provide are

  *   in the URL, /rest/net/[parent_net_handle-goes-here]/reallocate?apikey=[api-key-goes-here]
  *   content-type = application/xml
  *   method = PUT
  *   in the NET payload, the attributes:
  *   - version
  *   - orgHandle (this is the handle of the Org you’re reallocating to)
  *   - netBlocks collection, including: type (A), and a start-and-end OR start-and-cidr
  *   - netName
  *   - originASes collection (if applicable)
  *   - parentNetHandle (must match the [parent_net_handle-goes-here] from the URL)
  *   - optionally, the comment collection or pocLinks collection if you are providing this information.

We will be looking to improve the documentation to make this more clear.

Also, I have seen the “charsetName” error when you provide an empty tag for an enumerated value on occasion, so I believe that may be the issue. We will be exploring this bug, and making  a fix if necessary.

Best regards, and thank you for your feedback,
Tim Christensen
ARIN Engineering

On 4/12/11 7:12 PM, "Zhao, Sean" <Sean.Zhao at qwest.com> said:

Hi,
                My name is Sean Zhao from Qwest, one of your customer. I got a research assignment to see if we want to use Arin’s RESTful Server or some other servers. Since I am the original Arin’s email SWIP developer. I am doing the research of your RESTful Server first now. Now I got an issue here. On serviceClient.sendReceive, I keep on getting the error AxisFault message “charsetName”. That’s it! No more word.
Just one word of exception. I don’t know what to do. I will appreciate if anyone can help me

And don’t know where to go. I am scream for help.

I have java code looks like this, briefly

Options options = new Options();

      options.setTo(new EndpointReference(“https://www.arin.net/rest/net/NET-216-206-0-0-1/reallocate?apikey=MyAPIKey”));
      options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
options.setSoapVersionURI(org.apache.axiom.soap.SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
      options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION,
                              org.apache.axis2.transport.http.HTTPConstants.HEADER_PROTOCOL_10);

      options.setProperty(Constants.Configuration.HTTP_METHOD, “PUT”);
      options.setProperty(
                  org.apache.axis2.transport.http.HTTPConstants.CONTENT_TYPE,
                  org.apache.axis2.transport.http.HTTPConstants.MEDIA_TYPE_APPLICATION_XML);

      System.setProperty("javax.net.ssl.trustStore", "ssl/arin.jks");
      System.setProperty("javax.net.ssl.trustStorePassword", "arinLims");
      System.setProperty("javax.net.ssl.keyStore", "ssl/arin.jks");
      System.setProperty("javax.net.ssl.keyStorePassword", "arinLims");

ServiceClient serviceClient = new ServiceClient();
serviceClient.setOptions(options);

OMElement omElementResult = serviceClient.sendReceive(omElementPayload);

The omElementPayload loosk like this

<net xmlns="http://www.arin.net/regrws/core/v1">
        <version>4</version>
        <comment>
                <line number="1"></line>
        </comment>
        <registrationDate></registrationDate>
        <orgHandle>BNO</orgHandle>
        <handle></handle>
        <netBlocks>
                <netBlock>
                        <type>A</type>
                        <description></description>
                        <startAddress>216.207.149.16</startAddress>
                        <endAddress>216.207.149.23</endAddress>
                        <cidrLength>29</cidrLength>
                </netBlock>
        </netBlocks>
        <customerHandle>BCNO1-ARIN</customerHandle>
        <parentNetHandle></parentNetHandle>
        <netName>Q0412-216-207-149-16</netName>
        <originASes>
                <originAS>209</originAS>
        </originASes>
        <pocLinks>
                <pocLinkRef></pocLinkRef>
        </pocLinks>
</net>


And my key store file is generated by InstallCert, which I download from internet.
Am I doing anything wrong? What am I missing?

Appreciate any helps, hints or ideas.


Thanks,

Sean Zhao

________________________________
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.

________________________________
_______________________________________________
arin-tech-discuss mailing list
arin-tech-discuss at arin.net
http://lists.arin.net/mailman/listinfo/arin-tech-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.arin.net/pipermail/arin-tech-discuss/attachments/20110413/0a9f80da/attachment.html>


More information about the arin-tech-discuss mailing list